Machine-learning QI: neural networks for facies classification
Learning objectives
- Contrast rule-based (Section 7.5) vs data-driven (ML) facies classification
- Recognize OVER-FITTING: sparse training data + flexible model = wrong decision regions
- Understand the role of training-validation-test split for honest accuracy estimates
- Identify when ML adds value vs when simpler methods suffice
- Apply practical safeguards: data augmentation, regularization, blind-well validation
The classifiers in Section 7.5 used a RULE-BASED approach: explicit Gaussian likelihoods per class + Bayes’ rule to get posteriors. That works beautifully when the class distributions are well-characterized. But what if the class boundaries are non-Gaussian, or the rock physics is too complex to write down? Machine-learning classifiers sidestep the explicit rules by LEARNING the boundaries directly from labeled training data.
ML in QI is already mainstream for facies classification, and rapidly expanding into seismic-to-property mapping (ML-based inversion), horizon auto-tracking, noise attenuation, and even salt-body picking. This section focuses on the SIMPLEST and most MATURE application: ML classification on (Ip, Vp/Vs) features. The lessons about training-data discipline apply to every ML workflow.
What ML classifiers learn
Given a training set of (features, labels) pairs, where features are elastic attributes (Ip, Vp/Vs, density, ...) and labels are class identifiers (shale, brine sand, oil sand, gas sand), an ML classifier constructs a function f(features) → class label. The function is parameterized by weights that are learned by minimizing a training loss (typically cross-entropy for classification).
Architecture options:
- Linear (logistic regression): decision boundary is a hyperplane. Simple, robust, under-fits complex class shapes.
- k-Nearest Neighbors (kNN): vote among the k closest training samples. No training (just a lookup table); boundaries follow the training data. Sensitive to noise.
- Decision trees / random forests: axis-aligned splits. Robust, interpretable, good with tabular data.
- Neural networks (MLP): smooth flexible boundaries. Can capture any shape with enough data.
- Convolutional networks: for IMAGE or volume inputs (rarely used for tabular QI, more for seismic image segmentation).
- Gradient-boosted trees (XGBoost): often the top performer on tabular data. Industry favorite.
Exercise, train it yourself
The widget below does not simulate the idea of machine learning; it trains real classifiers, live, on a physical earth. A synthetic field (anticlinal sand with gas over oil over brine, a deeper brine sand, shale between) is turned into (Ip, Vp/Vs) features by the same Gassmann rock physics used in Sections 8.2 and 8.4, wells sample it, and the three models, a full-covariance Gaussian Bayes, k-nearest neighbours, and a small neural network trained by gradient descent in your browser, are fitted to the training wells only. Every accuracy in the readout is measured: on the training wells, on a blind well that is never trained on, and on the full field. The headline metric is BALANCED accuracy (mean per-class recall), because the field is 78% shale and a plain accuracy score stays high while missing every gas cell.
- Start in The field and its wells with 4 wells. The split is BY WELL: solid sticks train, the dashed blind well only tests. Now drop the wells slider to 2 and look at the summary line: the two flank wells contain ZERO gas samples. Switch to the predicted section: the gas cap is simply absent, for every model. No architecture can predict a facies it has never seen; data coverage beats everything.
- Bring the wells back to 4 or more and open Feature space. The clusters are not painted Gaussians: they are the rock physics evaluated over the field, curved by the porosity trend. Gas sits far from everything because Wood mixing collapses the fluid modulus; brine sand grazes the shale cloud, the classic ambiguity. The background is the decision map of the actual trained model.
- Pick k-nearest neighbours and set k = 1 with the noise around 80%. Training accuracy reads 100%, by construction, a memorizer cannot miss, while the blind well drops well below it. That gap IS overfitting, measured. Watch the crossplot grow islands around individual noisy samples.
- Now push k to 25 and open the confusion matrix. Gas recall collapses to ZERO even though gas is in the training set: with 25 neighbours voting, the shale majority outvotes the few gas samples. Small k overfits, large k lets class imbalance silence the rare facies, and the facies a well was drilled to find is always the rare one. k around 5 is the working middle.
- Switch between Gaussian Bayes and the neural network at low noise: they tie within a point or two. On near-elliptical clusters, the rule-based classifier is all you need. Now raise the noise toward 100%: the network pulls ahead by several points of balanced accuracy, because it is not committed to Gaussian cluster shapes. That, measured, is the honest version of "when ML wins".
- At any setting, compare the blind-well number against the full-field number. The blind well is the estimate a real project can compute; the field number is the truth only a synthetic world can reveal. They usually agree within a few points, which is exactly why blind-well validation is the standard, and when they disagree, remember the blind well is one well: a single test well has variance too.
The training / validation / test split
The #1 rule of ML in QI (and everywhere): NEVER evaluate your model on data it was trained on. You need three separate splits:
- Training set: used to fit the model weights. Typically 60-80% of labeled data.
- Validation set: used during training to tune HYPERPARAMETERS (learning rate, architecture size, regularization). Typically 10-20% of data.
- Test set: NEVER TOUCHED until the final model is locked in. Used ONCE to report the model’s honest accuracy. Typically 10-20% of data.
For QI, the splits must respect SPATIAL and GEOLOGICAL boundaries. Random splitting at the sample level leaks information: adjacent samples from the same well have similar features. Instead split by WELL: some wells fully in training, others fully in test. This is the "blind well" validation from Section 7.5, the standard for honest QI ML performance.
Published QI ML papers that don’t do blind-well testing are essentially useless for practical deployment. Always ask: how did they split? If they can’t answer, don’t trust the reported accuracy.
When ML beats rule-based (and when it doesn't)
- ML wins: (1) Non-Gaussian class distributions, multi-modal, curved, or irregular-shaped clusters. (2) Many features (5+); Bayesian Gaussian gets unstable in high dimensions but ML handles it. (3) Abundant training data (thousands of samples per class). (4) Complex interactions between features that rule-based models struggle to encode.
- Rule-based wins: (1) Simple, ellipsoidal class shapes (like our Section 7.5 example). (2) LIMITED training data. (3) When EXPLAINABILITY matters, rule-based classifiers can be traced through specific equations; ML black-box is harder to defend in regulated environments. (4) When you have GOOD ROCK-PHYSICS understanding that you don’t want to relearn from data.
- Hybrid wins (common in practice): use rule-based as the DEFAULT, then use ML to IMPROVE specific regions where rule-based struggles (e.g., non-Gaussian lobes, thin beds). Compare both outputs; trust regions where they agree, flag regions where they disagree.
Beyond classification: ML for inversion itself
The ML front has pushed beyond facies classification into SEISMIC INVERSION directly. Approaches:
- ML-assisted inversion: use an ML regressor to learn the mapping from seismic waveforms (near, mid, far offset data) to elastic properties (Ip, Is, ρ). Skips the rock-physics + inversion pipeline. Fast. Unreliable when training data doesn’t cover the target rock regime.
- Physics-informed neural networks (PINNs): neural networks with physics constraints (wave equation residual) as part of the loss. Combines ML flexibility with physical consistency. Emerging research, not yet mainstream.
- Unsupervised anomaly detection: autoencoders that learn the "typical" seismic appearance. Regions with high reconstruction error are potential anomalies (bright spots, unusual features). Useful for rapid screening of large surveys.
- Generative models: GANs and diffusion models that generate plausible reservoir realizations matching observed seismic. Used for uncertainty quantification beyond what stochastic inversion can do.
Most of these are in the RESEARCH-to-PILOT transition zone as of 2025. They will probably be mainstream in 5-10 years. The lessons from classification carry over: training data discipline matters more than architecture sophistication.
Practical ML-QI deployment checklist
- Training data audit: how many samples, balanced across classes, sampled from diverse geological settings? (> 100 per class is minimum.)
- Blind-well validation: test accuracy measured on wells NOT used in training. Report as THE accuracy, not the in-sample training accuracy.
- Regularization: L2 weight decay, dropout, early stopping to prevent over-fitting.
- Feature engineering: don’t just throw raw elastic attributes at the network. Include derived features (ratios, differences, log-space coordinates) that make the class boundaries more separable.
- Uncertainty quantification: use Monte Carlo dropout, ensemble methods, or Bayesian neural networks to get per-voxel confidence estimates. Don’t ship hard classifications without uncertainty.
- Post-deployment monitoring: every time a new well is drilled, compare predicted vs observed facies. Track accuracy over time. Retrain annually or when drift exceeds a threshold.
- Explainability: for high-stakes decisions (drill go/no-go), the ML prediction should come with FEATURE IMPORTANCE maps showing which elastic attributes drove the prediction. SHAP, LIME, or simpler gradient-based methods.
ML is a powerful tool for QI but not a magic wand. The same disciplines that govern good rule-based QI, well calibration, physical plausibility, uncertainty tracking, blind validation, apply with even more force to ML. A well-validated ML classifier can approach the analytical Bayesian optimum (Section 7.5) with minimal assumptions about class distributions; a poorly-validated one produces confident predictions that are systematically wrong. Section 8.6 closes Part 8 with the fastest-growing application of QI today: CO₂ storage and subsurface monitoring. It combines everything, rock physics, inversion, probabilistic facies, 4D, and ML, into a single, life-cycle monitoring program.
References
- Chopra, S., & Marfurt, K. J. (2007). Seismic Attributes for Prospect Identification and Reservoir Characterization. Society of Exploration Geophysicists.
- Chopra, S., & Marfurt, K. J. (2014). Seismic attributes, a promising aid for geologic prediction. CSEG Recorder.
- Mavko, G., Mukerji, T., & Dvorkin, J. (2009). The Rock Physics Handbook (2nd ed.). Cambridge University Press.
- Marfurt, K. J., Kirlin, R. L., Farmer, S. L., & Bahorich, M. S. (1998). 3-D seismic attributes using a semblance-based coherence algorithm. Geophysics, 63(4), 1150-1165.