Stratum lithology automatic identification method based on machine learning optimization model
By optimizing the model through machine learning and wavelet transform processing, and combining the sparrow search algorithm to optimize hyperparameters, an automated method for stratigraphic lithology identification was constructed. This method solves the problems of low identification efficiency and low accuracy in traditional methods, and achieves efficient and accurate automatic lithology identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- OIL & GAS SURVEY CGS
- Filing Date
- 2025-11-21
- Publication Date
- 2026-04-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional stratigraphic lithology identification methods rely on manual interpretation, which suffers from inconsistent interpretation results, time-consuming and labor-intensive processes, difficulty in quantifying interpretation standards, and low identification accuracy. In particular, they are difficult to accurately identify lithology when faced with complex well logging data.
An automatic stratigraphic lithology identification method based on machine learning optimization model is adopted. Wavelet transform is used to remove noise, and support vector machine (SVM), random forest (RF), and neural network (DNN) models are constructed. The hyperparameters are optimized by combining the sparrow search algorithm (SSA) to construct an automatic stratigraphic lithology identification model. The contribution of feature parameters is analyzed by the random forest algorithm.
It has achieved automated identification of stratigraphic lithology, improved identification efficiency and accuracy, solved the problems of data imbalance and noise interference, and enhanced the model's identification accuracy and generalization ability.
Smart Images

Figure CN121859072A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of stratigraphic lithology analysis technology, and specifically to an automatic stratigraphic lithology identification method based on a machine learning optimization model. Background Technology
[0002] Natural gas hydrates, as an important potential clean energy source, are of great significance to ensuring national energy security through exploration and development. Accurate identification of reservoir lithology is a crucial foundation for evaluating hydrate occurrence potential and optimizing pilot production strategies. Traditional formation lithology identification mainly relies on the manual interpretation of well logging curves by geological experts. This method has the following inherent limitations: 1. Interpretation results heavily depend on the professional knowledge and field experience of the interpreters; different interpreters may reach different conclusions; 2. Faced with massive amounts of well logging data, manual interpretation is time-consuming and labor-intensive, making it difficult to meet the needs of rapid evaluation; 3. It is difficult to quantify interpretation standards, making it difficult to guarantee identification accuracy and consistency; 4. When multiple well logging curves have complex response characteristics and overlap, the human brain struggles to accurately synthesize all the information.
[0003] Therefore, there is an urgent need for a method that can effectively handle data noise, solve the problem of data imbalance, and automatically identify stratigraphic lithology in order to improve identification accuracy and efficiency and provide reliable technical support for hydrate resource evaluation. Summary of the Invention
[0004] The purpose of this invention is to provide an automatic identification method for stratigraphic lithology based on a machine learning optimization model, so as to solve the technical problems of existing technologies that cannot effectively handle data noise, solve data imbalance, and automatically identify stratigraphic lithology.
[0005] To solve the above-mentioned technical problems, the present invention specifically provides the following technical solution:
[0006] An automatic stratigraphic lithology identification method based on a machine learning optimization model includes the following steps:
[0007] Obtain logging curves from multiple wells and plot a formation lithology distribution map based on the logging curves from multiple wells;
[0008] Wavelet transform was used to denoise the logging curves of each well, and representative data segments of various lithological data were selected from the denoised logging data based on the formation lithology distribution map to form a dataset.
[0009] A model for automatic identification of stratigraphy lithology was obtained by using machine learning algorithms to build a model based on a dataset and by optimizing hyperparameters and comparing performance.
[0010] The contribution of characteristic parameters of the automatic formation lithology identification model was analyzed using the random forest algorithm, and the well logging curves of each well were intersected to determine the ranking of influencing factors for formation lithology identification.
[0011] As a preferred embodiment of the present invention, the logging curve includes natural gamma, resistivity, sonic transit time, density, and well diameter.
[0012] As a preferred embodiment of the present invention, the lithology of the formation includes sandstone, mudstone, oil shale, and coal.
[0013] As a preferred embodiment of the present invention, the method for drawing the stratigraphic lithology distribution map includes:
[0014] The total number of logging data for sandstone, mudstone, oil shale, and coal in each well is counted in the logging curves.
[0015] Using sandstone, mudstone, oil shale, and coal as the x-axis and the total number of data points as the y-axis, a bar chart is drawn as the lithological distribution map of the strata.
[0016] As a preferred embodiment of the present invention, the method for constructing the dataset includes:
[0017] The total number of well logging data for the coal with the smallest data volume in the stratigraphic lithology distribution map is selected as the limited data volume;
[0018] Well logging data from sandstone, mudstone, and oil shale were selected with a limited data volume.
[0019] Well logging data from sandstone, mudstone, and oil shale will be selected with a limited amount of data and combined with well logging data from coal to form a dataset with a balanced data distribution.
[0020] As a preferred embodiment of the present invention, the method for constructing the automatic stratigraphic lithology identification model includes:
[0021] Divide the dataset into 80% as the training set and 20% as the validation set;
[0022] Three machine learning models for identifying stratigraphic lithology were obtained by training three models—Support Vector Machine (SVM), Random Forest (RF), and Distributed Neural Network (DNN)—based on the training set.
[0023] The Sparrow Search Algorithm (SSA) was used to evaluate the performance of three machine learning models based on the error of the validation set and to iterate and optimize the hyperparameters of Support Vector Machine (SVM), Random Forest (RF), and Distributed Neural Network (DNN).
[0024] The performance of the three optimized machine learning models was evaluated and compared, and the machine learning model with the best performance was selected as the automatic lithology identification model.
[0025] As a preferred embodiment of the present invention, the hyperparameters of the Sparrow Search Algorithm (SSA) optimizing the Support Vector Machine (SVM) include a penalty coefficient. Kernel function type, kernel function coefficients ;
[0026] The hyperparameters of the Sparrow Search Algorithm (SSA) optimized for Random Forest (RF) include: the number of decision trees. Limit the number of features considered in the branch, the minimum number of nodes required for the intermediate node branch, and the maximum depth F of the decision tree;
[0027] The hyperparameters of the Sparrow Search Algorithm (SSA) optimized neural network (DNN) include the number of nodes in the first hidden layer, the number of nodes in the second hidden layer, the number of nodes in the third hidden layer, and the learning rate. Batch size and number of iterations.
[0028] As a preferred embodiment of the present invention, the performance evaluation parameters include the fitness value of the Sparrow Search Algorithm (SSA) and the model's training time and prediction accuracy.
[0029] As a preferred embodiment of the present invention, the influencing factors for formation lithology identification are ranked as follows: depth, density, sonic transit time, natural gamma, well diameter, and resistivity.
[0030] As a preferred embodiment of the present invention, the algorithm flow of the Sparrow Search Algorithm (SSA) includes:
[0031] Step 1: Establish a population X consisting of n sparrows. The expression for population X is:
[0032] ;
[0033] Where d is the number of hyperparameters to be optimized. Let n be the position of the nth sparrow in dimension d;
[0034] Step 2: Set fitness value The fitness value represents an individual sparrow's ability to find food. The expression is:
[0035] ;
[0036] in, For the fitness function, Let be the fitness value of the nth sparrow. Let n be the position vector of the nth sparrow;
[0037] Step 3: Based on population X and fitness value The location update formula for the discoverer is set as follows:
[0038] ;
[0039] in, For the number of iterations, The maximum number of iterations, , They were respectively in the second sequence During the nth iteration, the 1st The sparrow that was the discoverer was in the first The position of the dimension It is a random number in [0,1]. This is the warning value, and its range is [0,1]. The safe value is [0.5, 1], Q is a random number that follows a normal distribution, and L is a 1×d matrix with all elements being 1;
[0040] Step 4: Based on population X and fitness value The location update formula for discoverers is set as follows:
[0041] ;
[0042] in, In the first In the next iteration, the sparrow, as the discoverer, is in the best position. Let A be the worst-case position of the sparrow that discovers the sparrow, and let A be a 1×d matrix where each element is randomly assigned a value of 1 or -1. ;
[0043] Step 5: Set the number of scout sparrows to 10% to 20% of the total population. Their initial positions are randomly generated within the population. The behavioral expression for scout alerts is:
[0044] ;
[0045] in, Let t be the current globally optimal sparrow position in the t-th iteration, β be a control parameter, a random number following a standard normal distribution, K be a uniform random number with a value range of [-1, 1], and ε be a small constant to avoid the denominator being zero; The fitness value of the sparrow acting as a scout. The sparrow in the best position in the whole game fitness value, Sparrow in the worst position globally The fitness value.
[0046] Compared with the prior art, the present invention has the following advantages:
[0047] This invention constructs a machine learning model for automatic identification of stratigraphic lithology, which can realize the automatic identification of stratigraphic lithology and improve the efficiency of lithology identification.
[0048] This invention fundamentally solves the two core problems of data imbalance and noise interference by innovatively constructing a balanced dataset and combining it with wavelet denoising preprocessing, thus significantly improving the model's recognition accuracy and generalization ability.
[0049] This invention employs the Sparrow Search Algorithm (SSA) to perform parallel intelligent optimization of the hyperparameters of three heterogeneous models: SVM, RF, and DNN. Through systematic performance comparison, it ensures that the final selected lithology identification model is the optimal solution for the current task, thereby improving the accuracy of lithology identification. Attached Figure Description
[0050] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0051] Figure 1 Flowchart of an automatic stratigraphic lithology identification method based on a machine learning optimization model provided in an embodiment of the present invention;
[0052] Figure 2 The logging curves for well DK2 provided in this embodiment of the invention;
[0053] Figure 3 The logging curves for well DK3 provided in this embodiment of the invention;
[0054] Figure 4 The logging curves for the SK2 well provided in this embodiment of the invention;
[0055] Figure 5 A distribution map of stratigraphic and lithological data in the Muli area provided for embodiments of the present invention;
[0056] Figure 6 This is an intersection diagram of logging curves for well DK2 provided in an embodiment of the present invention;
[0057] Figure 7 A comparison of DK2 well logging data before and after wavelet denoising provided in this embodiment of the invention;
[0058] Figure 8 The confusion matrix between the predicted lithology and the actual lithology provided by the optimized SVM, RF, and DNN models in this embodiment of the invention;
[0059] Figure 9 A comparison between the lithology predicted by the optimized SVM, RF, and DNN models provided in this embodiment of the invention and the actual lithology;
[0060] Figure 10 The feature parameter contribution analysis diagram provided for the embodiments of the present invention. Detailed Implementation
[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] like Figure 1 As shown, this invention provides an automatic stratigraphic lithology identification method based on a machine learning optimization model, comprising the following steps:
[0063] Obtain logging curves from multiple wells and plot a formation lithology distribution map based on the logging curves from multiple wells;
[0064] Wavelet transform was used to denoise the logging curves of each well, and representative data segments of various lithological data were selected from the denoised logging data based on the formation lithology distribution map to form a dataset.
[0065] A model for automatic identification of stratigraphy lithology was obtained by using machine learning algorithms to build a model based on a dataset and by optimizing hyperparameters and comparing performance.
[0066] The contribution of characteristic parameters of the automatic formation lithology identification model was analyzed using the random forest algorithm, and the well logging curves of each well were intersected to determine the ranking of influencing factors for formation lithology identification.
[0067] To achieve automated identification of formation lithology, this invention employs a machine learning model that predicts lithology categories based on well logging data and depth. To avoid potential performance bottlenecks associated with a single model, three models—Support Vector Machine (SVM), Random Forest (RF), and Deep Neural Network (DNN)—are constructed simultaneously. Furthermore, the SSA algorithm is used to perform parallel intelligent optimization of the hyperparameters of the three heterogeneous models (SVM, RF, and DNN). Through systematic performance comparison, the model with the best performance is determined as the automatic formation lithology identification model, ensuring the highest accuracy in automatic formation lithology identification.
[0068] Among them, the kernel functions of Support Vector Machines (SVM) mainly fall into three categories: polynomial kernel functions, radial basis functions (RBF), and sigmoid functions. This invention uses the radial basis function (RBF), whose expression is: .
[0069] The core approach of using SVM to solve problems encountered in regression fitting has shifted from finding the optimal plane to finding an optimal surface that minimizes the error between all original data and the target classification surface.
[0070] Generally, we assume the dataset contains l training samples. ,in , , This is the corresponding output value.
[0071] Let the regression polynomial established in the new space be: ;
[0072] in, Let ε be a linear loss function in a multinomial nonlinear function mapping expression.
[0073] ;
[0074] Where f(x) is the predicted value of the objective function; y is the true value. This means that if the difference between the objective expression f(x) and the true value y is less than or equal to ε, then the value of the loss function is equal to 0.
[0075] Slack variables were introduced The mathematical expression for SVM is:
[0076] ;
[0077] Where C is the penalty value, the larger C is, the larger the penalty function is for samples with training error greater than ε, and ε represents the upper limit of the objective function error. The smaller ε is, the smaller the objective function error is.
[0078] Use the Largerange function to solve for the dual form of the above equation:
[0079] ;
[0080] in, This is the kernel function.
[0081] Let the optimal solution obtained by the above equation be Then we can obtain the expressions for w* and b*. Therefore, the regression function is: .
[0082] Random Forest (RF), proposed by Leo Breiman in 2001, is an improvement on Bagging and consists of a large number of decision trees. RF can meet the needs of classification and regression. For classification, voting determines the prediction result of each decision tree, and the class with the most votes is selected. For regression, the mean of all decision trees is selected as the prediction result.
[0083] The RF regression model can be mathematically interpreted as follows: Given a specific dataset, X is the independent variable (input data), and Y is the dependent variable to be predicted (output data). Assuming that the distributions of (X,Y) are independent, a training set is randomly generated from (X,Y), and the prediction result is denoted as g(X). Then, its mean squared generalization error is expressed as: ;
[0084] Assuming there are h decision trees, what is the predicted value of h decision trees? The average value is the prediction result of random forest regression. If Then the following formula holds: ;
[0085] In the above formula The generalization error is represented by PE. ** When h is infinitely large, the average generalization error of a single decision tree is denoted as PE. * PE * satisfy: ;
[0086] The above equation satisfies: ;
[0087] in This represents the weighted correlation coefficient between the residuals. The final regression function for the randomization function is: ;
[0088] The construction steps or process of this algorithm are as follows:
[0089] Step 1: Use the Bootstrap resampling method to randomly select n samples with replacement from the dataset, repeating this sampling K times to obtain K training sample sets, which are independent and identically distributed. Simultaneously, the samples not selected in the K samplings are grouped into K out-of-bag (OOB) data sets, becoming the K test sample sets.
[0090] Step 2: Construct a decision tree using the K training samples extracted in Step 1. A random subspace method is used to select the node feature variables of the decision tree; that is, when a sample has n features, m features are randomly selected from each node of the decision tree. Then, the information values contained in these features are calculated, and the most representative feature and its corresponding value are selected from the m features for node splitting.
[0091] Step 3: Each tree will grow to its maximum extent until the number of samples in a node is less than the originally set threshold or the minimum mean square error is less than the set threshold, at which point the decision tree terminates.
[0092] Step 4: Based on the above steps, K decision trees were obtained. Combining these K decision trees can construct a random forest regression model. Then, inputting the data will yield... ,Will average As a prediction result of the random forest regression model.
[0093] After generating pre-pruned decision trees, feature importance can be obtained using the Gini index of each decision tree in the random forest. Let G be the Gini index, and if dataset A has M classes in a classification problem, the probability that a subset belongs to the Mth class is... Then the Gini index is: ;
[0094] In a decision tree, the change in the Gini index before and after pruning a certain internal node is denoted as V. Suppose that after pruning, two new nodes appear, and the Gini indexes of these two new nodes are denoted as . Then we have the following formula: ;
[0095] Let feature N be in the decision tree. Let S be the set of nodes that appear in the decision tree. Then, the feature N in the decision tree... The importance of is recorded as follows: ;
[0096] If there are K decision trees in a random forest, then the Gini score of feature N in the random forest algorithm is: ;
[0097] Finally, after normalizing the Gini indices obtained from different features, the importance ranking of the different features is obtained by sorting them.
[0098] Neural networks are products derived from the analysis, abstraction, and imitation of the operation of biological neural networks. They are network structures that connect a large number of individual neurons according to certain rules, forming a network capable of processing information in parallel. They belong to a type of intelligent mathematical operation model. This model was first proposed by an American psychologist who analyzed the characteristics of biological neurons and, after combining them with mathematical theory, proposed the first mathematical model of an artificial neuron.
[0099] A neural network consists of a large number of processing units called neurons (corresponding to nerve cells in the human brain). The function of a neuron is to calculate the inner product of the input vector and the weight vector, and then pass it through a nonlinear transfer function to obtain a scalar result.
[0100] ;
[0101] ;
[0102] Commonly used activation functions include:
[0103] (1) Sigmoid function: ;
[0104] (2) tanh function: ;
[0105] (3) ReLU function: ;
[0106] (4) Leaky ReLU function: ;
[0107] Taking a neural network model containing an input layer, two hidden layers, and an output layer as an example, the first... The linear coefficient from the i-th neuron in layer 1 to the j-th neuron in layer 1 is defined as... The bias of the j-th neuron in the l-th layer is defined as The bias of the j-th neuron in the l-th layer is defined as The output of the first hidden layer is calculated as shown in the following equation:
[0108] ;
[0109] Suppose that the activation function we choose is The output of the j-th neuron in the (l+1)-th layer is defined as Then the input to the second hidden layer is:
[0110] ;
[0111] The output calculation for the second hidden layer is shown in the following formula:
[0112] ;
[0113] The input to the output layer is:
[0114] ;
[0115] The output of the output layer is then:
[0116] ;
[0117] The general expression for the loss function of a neural network is: The loss function is used to measure the degree of inconsistency between the true value y and the predicted value f(x), and generally, a smaller value is better. A small loss function indicates that the machine learning model closely approximates the true distribution of the data, indicating good model performance; a large loss function indicates that the machine learning model deviates significantly from the true distribution of the data, indicating poor model performance. For regression problems, the loss function is:
[0118] ;
[0119] in, y represents the predicted result, and y represents the actual result.
[0120] Gradient descent is one of the most commonly used optimization algorithms and currently the most frequently used method for optimizing neural networks. It is an algorithm that reaches the minimum value of a function through iterative steps. To find a local minimum of a function using gradient descent, steps can be taken that are proportional to the negative value of the function's gradient (or approximate gradient) at the current point.
[0121] The gradient represents the directional derivative of a function at a given point, where the directional derivative along that direction reaches its maximum value; in other words, it is the derivative of the function at the current position. ;
[0122] In the formula, As the independent variable, For about The function, Let represent the gradient. Then the independent variable parameter in the i-th step should be equal to: ;
[0123] η is the learning rate. When the learning rate is too low, many steps are needed to converge. Conversely, when the learning rate is too high, gradient descent will fail to reach the minimum value.
[0124] The learning process of BP neural network reservoir modeling consists of two stages: The first stage is forward propagation, which involves inputting known reservoir geological information as training samples. Using the established network structure and the thresholds and weights obtained from the previous training step, the output of each neuron is calculated from the first layer onwards. This process processes the input geological variable data and outputs the results. The second stage is backpropagation, where the output error is propagated back through the hidden layers to the input layers, distributing the error to all units in each layer. This yields the error signal for each unit, which serves as the basis for adjusting the weights. Specifically, by comparing the deviation between the actual output and the expected parameters, the network error is determined and propagated back to the reservoir attribute data processing units, thus readjusting their connections. This process of forward and backward propagation of signals and adjustment of layer weights is repeated continuously. This continuous adjustment of weights is the network's learning and training process. This continues until the network's output error is reduced to an acceptable level or until a predetermined number of training iterations are completed.
[0125] Assumption It is known that the following can be calculated using the chain rule:
[0126] ;
[0127] and ;
[0128] Therefore, as long as the error of the lth layer is known... Then you can calculate , , , and Used to update the parameters w and b of the l-th layer. It is passed to the (l-1)th layer to further calculate the derivatives of the parameters of the (l-1)th layer.
[0129] The logging curves include natural gamma, resistivity, sonic transit time, density, and well diameter.
[0130] The geological lithology includes sandstone, mudstone, oil shale, and coal.
[0131] Methods for drawing stratigraphic lithology distribution maps include:
[0132] The total number of logging data for sandstone, mudstone, oil shale, and coal in each well is counted in the logging curves.
[0133] Using sandstone, mudstone, oil shale, and coal as the x-axis and the total amount of data as the y-axis, a bar chart is drawn as a stratigraphic lithology distribution map.
[0134] The methods for constructing datasets include:
[0135] The total number of well logging data for the coal with the smallest data volume in the stratigraphic lithology distribution map was selected as the limit data volume;
[0136] Well logging data from sandstone, mudstone, and oil shale were selected with a limited data volume.
[0137] Well logging data from sandstone, mudstone, and oil shale will be selected with a limited amount of data and combined with well logging data from coal to form a dataset with a balanced data distribution.
[0138] This invention abandons the practice of simply using all the original data, and creatively proposes to construct a training dataset by using the lithology with the least amount of data (such as coal) as the benchmark and performing balanced sampling on all types of lithologies. This fundamentally avoids the classification bias that machine learning models are prone to on imbalanced data, ensuring that the model has equal learning ability for all lithology categories, and significantly improving the recall rate and overall classification accuracy for rare lithologies.
[0139] This invention deeply integrates wavelet denoising, a signal processing technique, into the lithology identification process. After denoising, representative data segments are selected based on geological knowledge (lithology distribution map) rather than random sampling. Wavelet denoising effectively filters out high-frequency noise in well logging curves, improving data quality. The selection based on geological knowledge ensures the representativeness and geological rationality of the dataset, laying a clean and high-quality data foundation for training high-performance models.
[0140] Methods for constructing automatic stratigraphic lithology identification models include:
[0141] Divide the dataset into 80% as the training set and 20% as the validation set;
[0142] Three machine learning models for identifying stratigraphic lithology were obtained by training three models—Support Vector Machine (SVM), Random Forest (RF), and Distributed Neural Network (DNN)—based on the training set.
[0143] The Sparrow Search Algorithm (SSA) was used to evaluate the performance of three machine learning models based on the error of the validation set and to iterate and optimize the hyperparameters of Support Vector Machine (SVM), Random Forest (RF), and Distributed Neural Network (DNN).
[0144] The performance of the three optimized machine learning models was evaluated and compared, and the machine learning model with the best performance was selected as the automatic lithology identification model.
[0145] The hyperparameters of the Sparrow Search Algorithm (SSA) for optimizing Support Vector Machines (SVM) include the penalty coefficient. Kernel function type, kernel function coefficients ;
[0146] The hyperparameters of the Sparrow Search Algorithm (SSA) that optimize Random Forest (RF) include: the number of decision trees. Limit the number of features considered in the branch, the minimum number of nodes required for the intermediate node branch, and the maximum depth F of the decision tree;
[0147] The hyperparameters of the Sparrow Search Algorithm (SSA) optimized for a Deep Neural Network (DNN) include the number of nodes in the first hidden layer, the number of nodes in the second hidden layer, the number of nodes in the third hidden layer, and the learning rate. Batch size and number of iterations.
[0148] The performance evaluation parameters include the fitness value of the Sparrow Search Algorithm (SSA), the training time of the model, and the prediction accuracy.
[0149] This invention proposes a model construction framework based on parallel optimization of three models and comprehensive performance comparison. It utilizes the novel metaheuristic algorithm SSA to simultaneously optimize the hyperparameters of three models based on different principles: SVM, RF, and DNN. In other words, the SSA algorithm possesses powerful global search capabilities, efficiently and automatically finding near-globally optimal hyperparameter combinations, overcoming the blindness and inefficiency of traditional parameter tuning methods. Through multi-model comparison, the model most suitable for the current geological data characteristics can be objectively selected, ensuring the technical advancement and robustness of the proposed solution.
[0150] In the Sparrow Search Algorithm (SSA), sparrows can be categorized into three types: leaders, followers, and alerters. Within the population, leaders play a role in finding resources, providing clues such as foraging areas and directions. Followers, with their keen observation skills, capture the leader's movements to obtain food. Sparrows primarily utilize both leader and follower strategies for foraging, maintaining a cooperative yet competitive relationship. Alerters typically reside on the periphery of the population, where they are more vulnerable to predators, thus requiring them to constantly adjust their position to secure safer areas. Based on this brief overview, the following principles can be summarized:
[0151] (1) Resource reserve principle: Leaders usually control more food resources and are responsible for finding more favorable areas for the population, that is, areas with abundant food, and contacting followers to provide relevant foraging areas and directions.
[0152] (2) The principle of constant proportion: As long as a better resource is found, every sparrow can become a leader. However, the overall proportion of the two remains constant. That is to say, for every sparrow whose status changes to a leader, there must be another sparrow whose status changes to a follower. In other words, the status of leaders and followers is in a dynamic switching process.
[0153] (3) Warning and escape principle: If a sparrow discovers a predator, it will issue a warning. Once the warning value exceeds the warning threshold, the followers will escape to other safe areas to forage under the guidance of the leader.
[0154] (4) The principle of surveillance and plunder: When sparrows are foraging, they will always find the discoverer with the best food resources and obtain food from that area or forage around the leader. At the same time, if the followers want to improve their foraging rate, they will monitor the leader in real time in order to plunder food resources.
[0155] (5) The principle of flying towards the best: The scarcer the resources available to followers, the worse their foraging locations will be within the population. Some followers who are starving are more likely to fly to areas with more resources to forage.
[0156] (6) Warning and transfer principle: When a danger is sensed, sparrows on the periphery will immediately move to a safe location, while those in the middle of the population will adopt a random movement strategy to move closer to other individuals.
[0157] The process of the sparrow search algorithm includes:
[0158] Step 1: Establish a population X consisting of n sparrows. The expression for population X is:
[0159] ;
[0160] Where d is the number of hyperparameters to be optimized. Let n be the position of the nth sparrow in dimension d;
[0161] Step 2: Set fitness value The fitness value represents an individual sparrow's ability to find food. The expression is:
[0162] ;
[0163] in, For the fitness function, Let be the fitness value of the nth sparrow. Let n be the position vector of the nth sparrow;
[0164] Step 3: Based on population X and fitness value The location update formula for the discoverer is set as follows:
[0165] ;
[0166] in, For the number of iterations, The maximum number of iterations, , are, respectively, the positions of the th and th iterations of the th sparrow acting as the discoverer in the th dimension, is a random number in [0, 1]. is the warning value, with a value range of [0, 1], is the safety value, with a value range of [0.5, 1], Q is a random number subject to a normal distribution, and L is a 1×d matrix where each element is 1;
[0167] When R2 < ST occurs, it indicates that the foraging environment is safe at this time, no predator is found, and the discoverer can perform a large number of search operations;
[0168] When R2 > ST occurs, it indicates that an individual in the sparrow population has discovered a predator and issued an alarm. At this time, all sparrows will perform anti-predation behaviors and quickly transfer to other safe places to continue foraging;
[0169] Step 4: According to the population X, fitness value and the position update formula of the discoverer, set the position update formula of the joiner as:
[0170] ;
[0171] where is the best position of the sparrow acting as the discoverer at the <00…The fitness value of the sparrow acting as a scout. The sparrow in the best position in the whole game fitness value, Sparrow in the worst position globally The fitness value.
[0176] When f appears i =f g In this situation, it indicates that the sparrow in question is in the optimal position globally and will move closer to other sparrows to reduce the risk of being preyed upon.
[0177] When f appears i >f g In this situation, it indicates that the sparrow in question is on the edge of the population and is more vulnerable to predators, and will quickly move to the current optimal position.
[0178] Methods for optimizing hyperparameters in the Sparrow Search algorithm include:
[0179] Represent the position of each sparrow as a (penalty coefficient). Kernel function type, kernel function coefficients ) combination or (number of decision trees) The constraints are the number of features considered in the branch, the minimum number of nodes required for intermediate branches, and the maximum depth of the decision tree (F) combined with (the number of nodes in the first hidden layer, the number of nodes in the second hidden layer, the number of nodes in the third hidden layer, and the learning rate). The initial position is randomly generated within a preset range, using a combination of batch size and iteration steps, and is expressed as a relative standard error (RSEM) or correlation coefficient (R). 2 The fitness function is used to calculate the fitness value of the population. The population size and maximum number of iterations are set for the Sparrow Search Algorithm (SSA).
[0180] During the iteration process of the Sparrow Search Algorithm (SSA):
[0181] Update the position of the leading sparrow according to the discoverer's update formula, and explore new (penalty coefficient) Kernel function type, kernel function coefficients ) combination or (number of decision trees) The constraints are the number of features considered in the branch, the minimum number of nodes required for intermediate branches, and the maximum depth of the decision tree (F) combined with (the number of nodes in the first hidden layer, the number of nodes in the second hidden layer, the number of nodes in the third hidden layer, and the learning rate). Combinations of batch size and number of iterations;
[0182] The position of the following sparrow is updated according to the formula for updating the position of the introducer, so as to move closer to the high-quality solution;
[0183] The position of the early warning sparrow is updated based on the behavior formula of the reconnaissance and early warning system to avoid getting trapped in local optima.
[0184] The fitness values of all sparrows are recalculated after each iteration;
[0185] The position of the sparrow with the highest fitness that reaches the maximum number of iterations is used as the penalty coefficient. Kernel function type, kernel function coefficients () or (number of decision trees) The constraints include the number of features considered in the branch, the minimum number of nodes required for intermediate branches, and the maximum depth of the decision tree (F) or (the number of nodes in the first hidden layer, the number of nodes in the second hidden layer, the number of nodes in the third hidden layer, and the learning rate). The optimal combination solution of batch size and number of iterations.
[0186] This invention automates the entire process from model training and hyperparameter optimization to performance comparison. By setting the population and number of iterations of the SSA (Self-Assessing and Optimizing) algorithm, parallel optimization and evaluation of three machine learning models can be automatically completed, significantly reducing manual intervention and computational time costs, and improving analysis efficiency.
[0187] The factors influencing formation lithology identification, ranked in order of importance, are depth, density, sonic transit time, natural gamma, well diameter, and resistivity.
[0188] While completing the identification process, this invention utilizes the inherent interpretability of the random forest model to quantitatively analyze the contribution of different logging parameters to lithology identification, and supplements it with cross-plot analysis to make the model's decision-making process transparent, enhance geologists' trust in the model results, and provide valuable mechanistic insights for subsequent reservoir evaluation.
[0189] After completing the model construction, this invention does not treat it as a "black box," but actively utilizes the built-in feature importance assessment function of the random forest model to rank the key parameters affecting identification. This elevates machine learning from a simple "prediction tool" to an "analysis tool." The resulting contribution ranking (e.g., depth > density > sonic transit time...) provides geologists with clear physical insights, revealing the core controlling factors for lithological identification in the study area. This guides the selection of optimal logging projects and the optimization of interpretation models, demonstrating significant guiding value.
[0190] Example:
[0191] The Muli Depression is located in the upper reaches of the Datong River basin in the central Qilian Mountains. Its southern part lies within the thrust fault zone on the northern edge of the Datong Mountains, while its northern part is situated on the fault zone on the southern edge of the Tuolai Mountains. The overall structural morphology is a narrow, elongated compound syncline. Statistical analysis of logging parameters such as natural gamma ray, apparent resistivity, sonic transit time, density, and well diameter in the Muli permafrost region reveals differences in characteristics among different types of hydrate reservoirs. Generally, hydrate reservoirs are characterized by high resistivity. Specifically, sandstone hydrate reservoirs exhibit high resistivity and low natural gamma ray; mudstone fractured reservoirs show high resistivity and slightly lower density; and shale fractured reservoirs exhibit high resistivity and high P-wave velocity.
[0192] The Muli Formation is characterized by light gray to gray gravelly medium- to coarse-grained sandstone, gray medium- to fine-grained sandstone, dark gray siltstone, dark gray to brown silty mudstone, dark brown mudstone, and black massive coal. The sandstone is primarily feldspathic sandstone, with the feldspar weathered into kaolinite. The mudstone, after weathering, turns light brown. Shale structures are visible within the mudstone and shale. The lower part consists mainly of light gray to gray medium- to coarse-grained sandstone and light grayish-brown conglomerate, occasionally with medium- to fine-grained feldspathic sandstone, locally exhibiting massive and parallel bedding structures. The upper part mainly consists of light gray medium-grained feldspathic sandstone and light grayish-brown medium- to fine-grained sandstone, with parallel bedding, tabular cross-bedding, and massive bedding structures. Overall, the upper part has a finer lithology, characterized primarily by exposed coal seams.
[0193] Jiangcang Formation: The main lithology of this section is fine sandstone and siltstone interbedded with thin layers. According to different lithological characteristics, it can also be divided into upper and lower sections. The upper section is mainly composed of light gray fine sandstone and dark brown silty mudstone, with local interbedded layers of dark gray thin siltstone and thick mudstone. The lower section is more developed, with lacustrine and deltaic environments. The lithology is mainly light gray to gray medium-fine grained sandstone, with occasional interbedded layers of dark gray siltstone and gray sandstone. Thin coal seams are developed.
[0194] Based on well logging and well logging information, the lithology of the Muli area consists of medium sandstone, fine sandstone, siltstone, silty mudstone, mudstone, and oil shale, with siltstone, oil shale, and mudstone being the dominant elements. Therefore, this project classifies the lithology into four main categories: sandstone, mudstone, oil shale, and coal. Well logging curves include five types: well diameter, density, sonic transit time, natural gamma ray, and resistivity. The well logging curves for wells DK2, DK3, and SK2 are shown below. Figure 2 , Figure 3 and Figure 4 As shown.
[0195] The logging resolution of wells DK2 and DK3 is 0.05m, and that of well SK2 is 0.1m. Therefore, the logging data of wells DK2 and DK3 were resampled at a resolution of 0.1m. From the lithological data distribution map of each well (e.g....) Figure 5As shown in the diagram, the strata in the Muli area are mainly composed of sandstone and mudstone, with relatively equal proportions, less oil shale, and the least coal seams. The lithological distribution also varies among wells, particularly well DK2, which has the largest amount of oil shale, inconsistent with the overall lithological distribution characteristics of the region. This may be due to the complex geological structure, well-developed faults, and significant lithological variations in the study area, coupled with the complex hydrate occurrence states, which increases the difficulty of identifying hydrates and lithology in this region.
[0196] From DK2 well (e.g.) Figure 6 As shown in the cross-plots of various logging curves from wells DK3 and SK2, the coal seam can be identified relatively well based on the resistivity curve. However, the distribution of sandstone, mudstone, and oil shale shows significant overlap in the cross-plots, exhibiting complex distribution characteristics that make rapid identification of formation lithology difficult. The density, sonic transit time, and natural gamma ray cross-plots of sandstone are more concentrated, while those of mudstone and oil shale are relatively dispersed.
[0197] Well logging data contains a lot of noise, so denoising is necessary. The basic idea of wavelet denoising is to transform the signal using a wavelet transform (using the Mallat algorithm). The resulting wavelet coefficients contain important information about the signal. After wavelet decomposition, the wavelet coefficients of the signal are larger, while the wavelet coefficients of noise are smaller, and the wavelet coefficients of noise should be smaller than those of the signal. By selecting an appropriate threshold, wavelet coefficients larger than the threshold are considered to represent signal components and should be retained, while those smaller are considered to represent noise and are set to zero, thus achieving denoising. A comparison of DK2 well logging data before and after wavelet denoising is shown below. Figure 7 As shown.
[0198] The inconsistent distribution characteristics and data volume of different wells and lithologies make it difficult to meet the needs of machine learning. Therefore, data processing and filtering are necessary to ensure accuracy. According to... Figure 5 It can be seen that the coal seam logging data is the least abundant; therefore, the dataset selection should not exceed the amount of coal seam data. Representative data segments of each lithology type were selected and combined into 3464 data sets, including 866 sets each for sandstone, mudstone, oil shale, and coal.
[0199] The SSA algorithm, as an intelligent optimization algorithm, is used in this paper to optimize the hyperparameters of a machine learning model. First, three models—SVM, RF, and DNN—are trained based on the training set data. The SSA algorithm evaluates the performance of the machine learning models based on the error on the validation set and iterates to optimize the hyperparameters of the SVM, RF, and DNN models. 80% of the samples from 3464 sets of well logging data are randomly selected for training the models in the SSA algorithm, and the remaining 20% are used as the validation set. The SSA algorithm iterates 100 times, with a population size of 80. The range and optimal results of the SSA algorithm in optimizing the model hyperparameters are shown in Table 1.
[0200] Table 1. Range and results of hyperparameters for SSA algorithm-optimized machine learning algorithms:
[0201]
[0202] During the optimization of hyperparameters using the SSA algorithm, the change in fitness value reveals that the RF model has the largest fitness value, followed by the SVM model, and the DNN model has the smallest. The fitness value increases with the number of iterations. Specifically, the SSA algorithm only changed the fitness value twice when optimizing the SVM model, while it showed more changes when optimizing the RF and DNN models. Ultimately, all three optimized models achieved an accuracy of over 80% on the validation set.
[0203] The lithology of well DK2 was predicted using SSA-optimized SVM, RF, and DNN models. The lithology classification results were compared with the actual lithology. Figure 9 As shown, the optimized SVM performs poorly in predicting large, continuous sandstone and oil shale formations, with an accuracy of only 55%. The optimized RF and DNN models show better agreement between predicted and actual lithology, with the RF model achieving 78% and the DNN model reaching 83% (Table 2). However, both models predict small layers with incorrect lithology. In terms of training time, the SVM algorithm is the shortest, the RF model is the longest, and the DNN model is the most time-consuming. Considering both time cost and accuracy, the DNN model is the best, followed by the RF model, and the SVM model is the worst.
[0204] Table 2 Comparison of evaluation parameters for the SSA optimization algorithm:
[0205]
[0206] The confusion matrix between predicted lithology and actual lithology is obtained from the optimized SVM, RF, and DNN models (e.g., Figure 8 As shown in the figure, SVM has the highest accuracy in predicting sandstone (92%), followed by coal (67%). However, the main reason for SVM's high accuracy in predicting sandstone (92%) is that it labels mudstone and oil shale as sandstone, increasing the amount of data required for sandstone identification. RF model has good accuracy in predicting oil shale, coal, and sandstone, all exceeding 80%, but its performance in identifying mudstone is poor, tending to identify mudstone as sandstone. DNN model also has good accuracy in predicting oil shale, coal, and sandstone, all exceeding 85%, but its performance in identifying mudstone is poor, tending to identify mudstone as sandstone.
[0207] Ranking of feature parameters obtained from the random forest algorithm by their contribution (e.g.) Figure 10As shown in the figure, depth has the greatest impact on stratigraphic lithology identification. This is because stratigraphic deposits exhibit continuity and temporal sequence at depth, and stratigraphic deposits in the same region share similarities. The contributions of density, sonic transit time, natural gamma, well diameter, and resistivity decrease sequentially, but the differences between them are small. This indicates that relying on density, sonic transit time, natural gamma, well diameter, and resistivity as the basis for lithological classification cannot clearly distinguish the stratigraphic lithology of the Muli area.
[0208] This invention constructs a machine learning model for automatic identification of stratigraphic lithology, which can realize the automatic identification of stratigraphic lithology and improve the efficiency of lithology identification.
[0209] This invention fundamentally solves the two core problems of data imbalance and noise interference by innovatively constructing a balanced dataset and combining it with wavelet denoising preprocessing, thus significantly improving the model's recognition accuracy and generalization ability.
[0210] This invention employs the Sparrow Search Algorithm (SSA) to perform parallel intelligent optimization of the hyperparameters of three heterogeneous models: SVM, RF, and DNN. Through systematic performance comparison, it ensures that the final selected lithology identification model is the optimal solution for the current task, thereby improving the accuracy of lithology identification.
[0211] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. An automatic stratigraphic lithology identification method based on a machine learning optimization model, characterized in that, Includes the following steps: Obtain logging curves from multiple wells and plot a formation lithology distribution map based on the logging curves from multiple wells; Wavelet transform was used to denoise the logging curves of each well, and representative data segments of various lithological data were selected from the denoised logging data based on the formation lithology distribution map to form a dataset. A model for automatic identification of stratigraphy lithology was obtained by using machine learning algorithms to build a model based on a dataset and by optimizing hyperparameters and comparing performance. The contribution of characteristic parameters of the automatic formation lithology identification model was analyzed using the random forest algorithm, and the well logging curves of each well were intersected to determine the ranking of influencing factors for formation lithology identification.
2. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 1, characterized in that: The logging curves include natural gamma, resistivity, sonic transit time, density, and well diameter.
3. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 2, characterized in that: The geological lithology includes sandstone, mudstone, oil shale, and coal.
4. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 3, characterized in that: The method for drawing the stratigraphic lithology distribution map includes: The total number of logging data for sandstone, mudstone, oil shale, and coal in each well is counted in the logging curves. Using sandstone, mudstone, oil shale, and coal as the x-axis and the total number of data points as the y-axis, a bar chart is drawn as the lithological distribution map of the strata.
5. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 4, characterized in that: The methods for constructing the dataset include: The total number of well logging data for the coal with the smallest data volume in the stratigraphic lithology distribution map is selected as the limited data volume; Well logging data from sandstone, mudstone, and oil shale were selected with a limited data volume. Well logging data from sandstone, mudstone, and oil shale will be selected with a limited amount of data and combined with well logging data from coal to form a dataset with a balanced data distribution.
6. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 5, characterized in that: The method for constructing the automatic stratigraphic lithology identification model includes: Divide the dataset into 80% as the training set and 20% as the validation set; Three machine learning models for identifying stratigraphic lithology were obtained by training three models—Support Vector Machine (SVM), Random Forest (RF), and Distributed Neural Network (DNN)—based on the training set. The Sparrow Search Algorithm (SSA) was used to evaluate the performance of three machine learning models based on the error of the validation set and to iterate and optimize the hyperparameters of Support Vector Machine (SVM), Random Forest (RF), and Distributed Neural Network (DNN). The performance of the three optimized machine learning models was evaluated and compared, and the machine learning model with the best performance was selected as the automatic lithology identification model.
7. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 6, characterized in that: The hyperparameters of the Sparrow Search Algorithm (SSA) that optimizes the Support Vector Machine (SVM) include the penalty coefficient. Kernel function type, kernel function coefficients ; The hyperparameters of the Sparrow Search Algorithm (SSA) optimized for Random Forest (RF) include: the number of decision trees. Limit the number of features considered in the branch, the minimum number of nodes required for the intermediate node branch, and the maximum depth F of the decision tree; The hyperparameters of the Sparrow Search Algorithm (SSA) optimized neural network (DNN) include the number of nodes in the first hidden layer, the number of nodes in the second hidden layer, the number of nodes in the third hidden layer, and the learning rate. Batch size and number of iterations.
8. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 7, characterized in that: The performance evaluation parameters include the fitness value of the Sparrow Search Algorithm (SSA), the training time of the model, and the prediction accuracy.
9. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 8, characterized in that: The factors influencing formation lithology identification are ranked as follows: depth, density, sonic transit time, natural gamma, well diameter, and resistivity.
10. The method for automatic identification of stratigraphic lithology based on a machine learning optimization model according to claim 7, characterized in that: The algorithm flow of the Sparrow Search Algorithm (SSA) includes: Step 1: Establish a population X consisting of n sparrows. The expression for population X is: ; Where d is the number of hyperparameters to be optimized. Let n be the position of the nth sparrow in dimension d; Step 2: Set fitness value The fitness value represents an individual sparrow's ability to find food. The expression is: ; in, For the fitness function, Let be the fitness value of the nth sparrow. Let n be the position vector of the nth sparrow; Step 3: Based on population X and fitness value The location update formula for the discoverer is set as follows: ; in, For the number of iterations, The maximum number of iterations, , They were respectively in the second sequence During the nth iteration, the 1st The sparrow that was the discoverer was in the first The position of the dimension It is a random number in [0,1]. This is the warning value, and its range is [0,1]. The safe value is [0.5, 1], Q is a random number that follows a normal distribution, and L is a 1×d matrix with all elements being 1; Step 4: Based on population X and fitness value The location update formula for discoverers is set as follows: ; in, In the first In the next iteration, the sparrow, as the discoverer, is in the best position. Let A be the worst-case position of the sparrow that discovers the sparrow, and let A be a 1×d matrix where each element is randomly assigned a value of 1 or -1. ; Step 5: Set the number of scout sparrows to 10% to 20% of the total population. Their initial positions are randomly generated within the population. The behavioral expression for scout alerts is: ; in, Let t be the current globally optimal sparrow position in the t-th iteration, β be a control parameter, a random number following a standard normal distribution, K be a uniform random number with a value range of [-1, 1], and ε be a small constant to avoid the denominator being zero; The fitness value of the sparrow acting as a scout. The sparrow in the best position in the whole game fitness value, Sparrow in the worst position globally The fitness value.