Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROGII Geosteering Toolkit

A domain-aware approach to the ROGII Wellbore Geology Prediction Kaggle competition, focusing on geological reasoning and reusable tools for horizontal well analysis.

Kaggle notebook: rogii-wellbore-geology-prediction-toolkit

The problem

773 horizontal wells, each with a gamma ray (GR) log, an XYZ trajectory, and a paired vertical typewell (GR + TVT + formation labels). The task: predict True Vertical Thickness (TVT) for the masked toe-end portion of each lateral, where TVT is hidden. TVT is the well's stratigraphic position on the formation column, not a depth coordinate.

If you've ever correlated LWD gamma ray against an offset well to figure out where the bit is in the formation, this is that problem, formalized as a prediction challenge.

What the notebook does

Single LightGBM with StratifiedGroupKFold cross-validation, stratified by signed drilling azimuth, median TVT, and spatial location. The feature set includes multi-scale normalized cross-correlation (NCC) against the typewell, self-correlation against the lateral's own known section, Q-3D wellbore tortuosity, trajectory features with a lateral-only structural baseline, offset-well prior features from neighboring wells, and landing-zone state features encoding the bit's condition at prediction start.

The notebook includes a cumulative ablation table showing which feature groups earned their place and which didn't.

Key findings

Within-well TVT-Z decoupling. The global TVT-vs-Z correlation across all wells is r = -0.96. Within a single well's lateral section, the relationship is essentially zero (mean slope +0.057). The global correlation is a cross-well structural-elevation signal dominated by build-section geometry. Within the lateral, TVT change is driven by the relative motion between the bit's vertical trajectory (the operator's steering choice) and the formation's vertical position (its dip in the bit's azimuth direction). See methodology/within_well_tvt_z_decoupling.md for the full analysis.

Q-3D tortuosity was the most useful domain feature. Tortuosity (Jing et al. 2022) captures cumulative high-frequency oscillation along the lateral. High tortuosity sections correlate with active steering, which signals formation deviation from plan. This was the single largest per-group improvement in the ablation (-0.107 RMSE).

Signed drilling azimuth matters. Two wells at the same E-W orientation but drilled in opposite directions encounter the formation in opposite sequence. The updip/downdip distinction is operationally real: drilling updip is preferred because landing errors are recoverable when the formation rises toward the bit. The bimodal NW-SE azimuth distribution in this dataset reflects local updip-direction variation across the field.

Well-level time-series features overfit under GroupKFold. Adding 46 features from the AEON toolkit (Catch22 + ClaSP) made the model worse by +0.476 RMSE. Well-level features under GroupKFold-by-well overfit on incidental cross-well correlations that don't generalize. See methodology/AEON_evaluation.md for the analysis, including a proof that AEON's MassSNN is mathematically equivalent to scipy NCC up to a monotonic transform.

Spatial cross-validation was considered and rejected. Verde's BlockKFold was evaluated for spatial CV but the validation wells are spatially interleaved with training wells (interpolation, not extrapolation), making spatial blocking more pessimistic than the actual test condition. StratifiedGroupKFold with domain-aware strata was used instead.

Reusable toolkit

These modules are general-purpose and can be used independently of this competition:

toolkit/wellbore_tortuosity.py

Q-3D wellbore tortuosity computation based on Jing et al. (2022). Two entry points:

  • compute_tortuosity(md, inc, azi, ...) - from survey-station data (MD, inclination, azimuth)
  • compute_tortuosity_from_xyz(md, x, y, z, ...) - from cartesian trajectory (added for this competition; derives inclination and azimuth from successive XYZ deltas)

Both return per-portion tortuosity indices: T_incline, Gamma_incline, TQG_incline, T_azimuth, Gamma_azimuth, TQG_azimuth, and the combined TQG_Q3D.

toolkit/despike.py

Two-stage log despiking: rolling-median filter followed by z-score outlier rejection.

toolkit/zone_monitor.py

Sliding distance correlation (dcor_sliding) for GR shape matching between lateral and typewell logs. Useful for geosteering applications where normalized cross-correlation may miss non-linear dependence.

Competition-specific code

kaggle/rogii_features.py

Feature extraction for all groups: multi-scale NCC, self-correlation, trajectory features with lateral-only structural baseline, Q-3D tortuosity, formation classifier, offset-well prior, landing-zone state, well-length features, and optional AEON/dcor features with budget timeouts.

kaggle/rogii_cv.py

StratifiedGroupKFold with spatial-table construction, stratum-label generation (signed azimuth quadrant, median TVT bins, XY grid bins), fold assignment, and fold-balance verification.

Figures

Phase 1 spatial reconnaissance figures are in kaggle/figures/:

  • fig1_well_centers.png - Well centers colored by signed azimuth and median TVT
  • fig2_azimuth_rose.png - Bimodal NW-SE drilling azimuth distribution
  • fig3_tvt_vs_z.png - TVT vs Z: 150-well overlay + single-well linear fit
  • fig3b_per_well_lateral_slope_distribution.png - Per-well lateral-only TVT-Z slopes (mean +0.057)
  • fig3c_lateral_slope_vs_signed_azimuth.png - Lateral slope vs signed azimuth, colored by R-squared

Citations

License

MIT

About

Domain-aware toolkit and methodology for the ROGII Wellbore Geology Prediction Kaggle competition.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages