A New Machine-Learning Framework Reads the Geological Continuity Hidden in Well Logs
A machine-learning system designed to identify underground rock types has achieved substantially higher accuracy by teaching an algorithm to recognize that neighboring layers in the Earth are rarely unrelated. The framework, called SClith, combines conventional numerical measurements from well logs with information about how those measurements change vertically through a borehole. In tests using a complex geological dataset from China’s Ordos Basin, the approach improved lithology-identification accuracy by 11.4–13.7 percent compared with direct classification and by 3.5–9.5 percent compared with a widely used clustering-based method. The results suggest that a relatively lightweight form of artificial intelligence could help geologists interpret subsurface formations more reliably without requiring the enormous training datasets often demanded by deep-learning sequence models.
Lithology identification is the process of determining which rocks occur at particular depths underground. It is central to petroleum exploration, reservoir modeling and the assessment of geological formations, because rocks with different grain sizes, mineral compositions and pore structures can behave very differently when they contain water, oil or gas. The primary data source is often the well log: a set of continuous measurements recorded as a drilling tool moves through a borehole. Natural gamma radiation, density and other physical properties produce curves that fluctuate with depth, creating a numerical signature of the formations crossed by the well. Traditionally, machine-learning models divide these curves into individual depth samples and classify each sample independently. That strategy is mathematically convenient and works with relatively small labeled datasets, but it can produce geologically implausible results, such as isolated one-point changes from sandstone to mudstone and back again.
The problem arises because a depth sample contains only part of the geological story. Sedimentary formations generally possess vertical continuity: a layer tends to extend over a finite thickness, and transitions between rock types often reflect depositional processes rather than random changes. Density, porosity and gamma-ray responses commonly vary coherently across adjacent measurements. Treating each point as an independent observation discards this structure. Fully sequence-based approaches, including recurrent neural networks, long short-term memory networks and Transformers, can model relationships across depth, but they are usually data-hungry and may be unreliable when labeled wells are limited. SClith was developed as a compromise. It retains the practical point-wise classification framework while adding engineered features that summarize local vertical organization before the supervised model makes its prediction.
The first stage uses simple non-iterative clustering, or SNIC, to segment a well-log curve into connected intervals. SNIC was originally developed for image segmentation, where it groups neighboring pixels into compact regions with similar visual properties. Unlike ordinary K-Means clustering, which groups observations according to numerical similarity alone, SNIC also accounts for spatial proximity and enforces connectivity. In the one-dimensional version used for well logs, each sample is represented by a feature vector—such as normalized natural gamma-ray and density values—together with its depth coordinate. The algorithm assigns samples to nearby cluster centers using a distance that combines feature differences with depth separation. A compactness parameter controls the balance: a lower emphasis on depth favors numerical similarity, while a stronger depth term encourages continuous intervals.
SNIC’s computational design is important because it avoids repeatedly recalculating all cluster assignments. K-Means alternates between assigning points to clusters and recomputing cluster centers until the solution stabilizes. SNIC instead grows connected segments from initialized seeds using a priority queue. At each step, the neighboring sample with the smallest combined feature-and-depth distance is added, and the cluster centroid is updated incrementally. For a one-dimensional log, initial seeds are distributed along the depth interval, with the approximate spacing determined by the number of samples divided by the desired number of clusters. Once all samples have been assigned, each segment can be represented by its mean or other summary attributes. These segmentation-derived values are then fused with the original log measurements, giving the classifier both the raw signal and a compact description of its local stratigraphic context.
The researchers tested the enhanced features with three supervised algorithms: random forest, XGBoost and a Transformer. Random forest combines the votes of many decision trees, each trained using randomized subsets of data and features. XGBoost builds trees sequentially, with each new tree focusing on errors left by earlier ones, while regularization limits overfitting. Its objective function combines a prediction-loss term with penalties related to tree complexity and leaf weights. The Transformer uses self-attention, projecting the input into query, key and value representations so that relationships within a sequence can be weighted during prediction. However, because the study’s main formulation still treated depth samples as point-wise inputs, the Transformer could not fully exploit its ability to construct long-range attention patterns. In this setting, the researchers found that XGBoost was generally the most effective and sample-efficient model.
The evaluation used data from the Yanchang Oilfield in the southeastern Yishan Slope of the Ordos Basin. The geological succession includes the Permian Shiqianfeng, Shihezi and Shanxi formations, along with the Carboniferous Taiyuan and Benxi formations. These units record a transition from marine–continental and shallow-marine environments toward deltaic, fluvial and lacustrine systems under increasingly continental conditions. The dataset included clastic rocks, coal, limestone, dolomite and gypsum. The clastic rocks were further divided according to grain size into conglomerate, coarse sandstone, medium sandstone, fine sandstone, siltstone and mudstone. Such diversity makes the dataset a demanding test: some rocks have distinctive log responses, while others overlap substantially, and minority lithologies may be represented by far fewer samples than dominant units.
Across repeated experiments, SClith consistently outperformed direct classification, in which the original log features were sent straight to a supervised model. It also surpassed schemes that appended cluster labels generated by K-Means. In representative comparisons, SNIC-enhanced inputs raised test accuracy over K-Means-enhanced inputs by 3.8 percentage points for random forest, 4.0 points for XGBoost and 9.3 points for the Transformer. The corresponding accuracies reached 85.1 percent, 94.2 percent and 92.1 percent, respectively. XGBoost delivered the strongest result among the tested classifiers, reaching 94.2 percent in that comparison. The researchers attribute the advantage to SNIC’s ability to preserve both connected intervals and boundaries, reducing the cross-layer confusion that can occur when a clustering algorithm responds only to numerical distance and local noise.
The improvements were not uniform across every rock type. Mudstone and limestone were the most stable and easiest to identify in sensitivity tests, with XGBoost F1-scores—an accuracy measure balancing precision and recall—typically around 70–80 percent for the strongest classes. Dolomite, coal and medium sandstone responded more strongly to SNIC’s parameters. The compactness parameter produced clearer separation near a value of 18, while balanced performance was obtained with an initial step size of roughly 14–18 samples. Fine sandstone, siltstone, conglomerate, coarse sandstone and gypsum remained difficult to distinguish, often recording much lower F1-scores. These weaknesses reflect both overlapping physical signatures and class imbalance, in which abundant lithologies can dominate the training process. The authors also observed that identification of transitional facies remains a significant challenge.
The researchers emphasize that SClith is not a replacement for genuinely sequence-based geological modeling, but a bridge toward it. Its SNIC stage has near-linear computational complexity and single-pass convergence, making it potentially practical for large collections of well logs. Hyperparameters were selected using the elbow method for clustering and Bayesian optimization for the integrated framework. Bayesian optimization uses a probabilistic model of the performance landscape to choose promising parameter settings without exhaustively testing every possibility. Future versions could incorporate geological priors such as sandstone thickness, depositional continuity and anisotropy, as well as seismic attributes, core descriptions and stratigraphic markers registered to the same depths. The study also proposes sequence-to-sequence models that use non-overlapping depth intervals, helping prevent data leakage and allowing attention-based networks to learn genuine vertical relationships. For now, the central finding is straightforward: when an algorithm is given not only what a log measures but also how neighboring measurements fit together, its interpretation of the rocks beneath our feet can become markedly more geological.

