Vugs are the porosity an interpreter most wants to count and most hates counting. In a dolomitised carbonate, dissolution vugs carry a disproportionate share of the secondary porosity that drives flow — and they are picked by eye, blob by blob, off a resistivity image log, at whatever depth resolution a tired interpreter can sustain. For a mid-sized Middle East carbonate operator we partnered with, we replaced that manual blob-by-blob count with a fully classical computer-vision pipeline that quantifies vug percent every 10 cm down the entire well, and agrees with expert picks to a mean absolute error of 1.21 cm². No deep network. No labelled training set. Just the right sequence of image-processing operators, each one defensible to a petrophysicist.
This is the deliberate counterpoint to the deep-learning work in the same programme. Vug quantification did not need a Detection Transformer; it needed a transparent, parameter-auditable algorithm whose every decision an interpreter could inspect and overrule. The engineering discipline here is classical CV and algorithm design — mode statistics, adaptive thresholding, contour geometry — productionised to run unattended across a multi-hundred-metre log.
Why vugs resist a learned model
A fracture is a curve; a bedding plane is a curve. A vug is a blob — an irregular, low-resistivity patch where rock dissolved away. On a dynamically normalised high-resolution borehole image log, vugs read as dark spots against a brighter matrix, because the conductive fill sits at lower resistivity than the surrounding section. That sounds like an easy segmentation target until you look closely: vug contrast drifts with borehole conditions, mud, and tool; the "matrix" intensity is not constant down the well; and the features you must not count — drilling-induced fractures, wellbore-parallel artifacts, the dark trace of a real bedding plane — share the same low-resistivity signature.
A supervised segmentation model would demand a labelled vug mask for every well, and would silently fail the moment a new well's normalisation shifted the intensity distribution out of its training range. For a corpus of two cored carbonate wells, with validation on a third, that is the wrong tool. What the operator needed was a pipeline whose behaviour is governed by a handful of named, physically meaningful parameters — one an interpreter can re-tune per well in minutes, not a black box that needs re-labelling and re-training.
The pipeline, operator by operator
The algorithm runs on each unwrapped image log in 1-metre processing zones, computing statistics at every 0.1 m (10 cm) interval. Pixel intensities are min–max scaled to the 0–255 range. Within each zone, four stages turn raw pixels into a vetted vug catalogue.
Stage 1 — Top-k mode subtraction. The matrix is the most common thing in the image. We compute the top-5 intensity modes (K=5) of the patch and subtract them, with a mode-separation of delta-m=5 intensity levels so the five modes describe genuinely distinct populations rather than five neighbours of the same peak. Subtracting the modes flattens the matrix background and lifts the anomalously dark vug pixels out of it — a classical, distribution-aware background-removal step that needs no per-well brightness calibration.
Stage 2 — Adaptive thresholding. A global threshold cannot survive the intensity drift down a real log, so we threshold adaptively: each pixel is compared against the mean of its local neighbourhood, a square block of size n. Block size is the single most consequential image-processing knob, because it sets the spatial scale at which "anomalous" is judged. We swept it — n = 11px covers 5.87 cm² of borehole, n = 31px covers 46.58 cm², n = 51px covers 126.08 cm² — and settled on block size 31 with a one-pixel step. Too small and the block sits inside a single vug, erasing it; too large and it averages across multiple features and washes out the contrast. The offset constant C defaults to the local mean intensity.
Stage 3 — Contour extraction and de-duplication. Adaptive thresholding over the mode-subtracted stack yields candidate contours, many of them duplicates traced from adjacent modes. We collapse near-identical contours using a centroid-distance test (tau=5) and an intersection-over-union merge at IoU 0.2, so a vug seen across several modes resolves to one object rather than five.
Stage 4 — The geometric gate. This is where false positives die. Each surviving contour is judged on area and circularity. A dissolution vug is roughly equant; a drilling-induced fracture, a bedding trace, or a wellbore-parallel streak is elongated. We keep a circularity gate of 0.3–1.0 to reject the linear features and retain the near-circular ones, then bound the area to the physically observed vug range. Two complementary refinements minimise the residual false positives: a Laplacian bounding-box expansion of 10% per side (20% total) sharpens edge contours, and a mean-based filter using an enlarged circle of radius 2R validates the blob against its local background.
That single gate is the heart of the method, and it is worth dwelling on what the field actually showed. Across the validated wells, the genuine vug population spread in circularity from 0.28 to 0.85, peaking at 0.45–0.7 — semi-circular blobs dominate, exactly as dissolution geometry predicts. Their areas concentrated in the 1–3.5 cm² band within an observed range of 1–12 cm². The gate is not an arbitrary hyperparameter; it is a geometric statement about what a vug is, and an interpreter can read it off the catalogue and adjust it on sight.
Per-well re-tuning, not re-training
The decisive design property is that the entire pipeline is governed by named parameters with physical meaning, so adapting it to a new well is a tuning exercise, never a labelling-and-training one. Validation ran across three wells of deliberately different character: a vertical well logged with a high-resolution borehole image log; a horizontal well logged with a compact microresistivity tool roughly 10 km away; and a second vertical well about 12 km from the first. The two microresistivity imaging tools carry different intensity dynamic ranges, and a horizontal well changes how features project — so a single fixed parameter set would not have held.
It did not need to. Moving to the second vertical well, an interpreter raised the block size to 51 to match its coarser feature scale and adjusted the Laplacian and mean-based thresholds; the horizontal well took its own Laplacian and mean-based settings and a shifted offset constant. Each adjustment is a one-line change to a documented parameter, traceable in a log, reproducible by the next analyst. Compare that to the alternative — re-mask, re-split, re-train, re-validate a segmentation network per well — and the operating-cost difference for a working petrophysics team is the entire argument.
Before
Manual blob-by-blob picking
Interpreter counts vugs by eye off the image log; resolution and consistency vary with fatigue; no auditable parameters
After
Adaptive-threshold CV pipeline
Vug % every 10 cm across the whole well; named, per-well-tunable parameters; MAE 1.21 cm² vs expert picks
~85% alignment with expert picks; caught vugs the manual interpretation missed at three intervals
What the numbers said against the experts
Accuracy for a quantification pipeline is not a detection F1 — it is agreement with the human gold standard on the quantity that matters, vug percent per interval, defined simply as vug area divided by interval area. Computed every 10 cm and compared against expert picks, the pipeline held a mean absolute error of 1.21 cm², an overall ~85% alignment with the interpreter's own counts.
The more interesting result is where the algorithm and the human disagreed. At three depth intervals the pipeline flagged genuine vugs that the operator's manual interpretation had missed — small, low-contrast blobs that survive a mode-subtracted adaptive threshold but slip past a tired eye. The pipeline was not merely reproducing the expert; at the margin it was outperforming the manual pass on sensitivity. The honest entry in the ledger is the failure mode in the other direction: at one interval the geometric gate let through a drilling-induced fracture misidentified as a vug — a reminder that the circularity gate is a strong prior, not a perfect classifier, and that a final interpreter pass over flagged contours remains part of the workflow.
Statistics an interpreter can build a model on
Because the output is a vetted contour set rather than a single percentage, every 10 cm interval emits a full statistical profile: total vug count, total area, mean area, standard deviation of area, the area/porosity spectrum, a circularity spectrum, and an azimuth spectrum. That last one matters for anyone asking whether dissolution is fabric-controlled — the azimuth distribution of vugs around the borehole is a downstream input a manual count never cheaply produces. The pipeline does not just answer "how much"; it characterises the population.
Why classical CV was the right call
It is tempting, inside a programme that also ships Detection Transformers, to reach for a network everywhere. The vug work is the disciplined counter-example. Where a problem is governed by a small number of physically interpretable decisions — background statistics, local-contrast scale, geometric shape — a transparent classical pipeline can match expert judgment, adapt across wells by re-tuning rather than re-training, and survive an audit by the petrophysicist who has to sign the porosity number. Across our subsurface engagements — with operators in the Middle East and the United States — the recurring lesson is the same: choose the model to the data regime and the validation burden, not to fashion. For two cored carbonate wells and a third validation well, the right model had no learned weights at all.
Why an adaptive-threshold CV pipeline beat a learned model for vugs
- Vugs are blobs governed by a few physical decisions — background statistics (top-5 mode subtraction), local-contrast scale (block size 31 = 46.58 cm²), and shape (circularity gate 0.3–1.0) — so a transparent classical pipeline fits better than a network that needs per-well labels and re-training.
- Quantifying vug percent every 10 cm across the well, the pipeline agreed with expert picks to a mean absolute error of 1.21 cm² (~85% alignment) and caught real vugs the manual interpretation missed at three intervals.
- Named, physically meaningful parameters let an interpreter adapt to a new well (across two different imaging tools, vertical→horizontal) by re-tuning block size and thresholds in minutes — never re-labelling and re-training — which is the decisive operating-cost advantage for a working petrophysics team.
References
-
Vug-quantification pipeline, accuracy, and parameter values derived from internal validation on a two-well cored carbonate dataset with three-well cross-validation; data and code withheld under operator confidentiality.
-
Statistical outputs and circularity/area distributions reported per 0.1 m depth interval; comparison baseline is the operator's manual vug interpretation.