The hardest two metres of a borehole image log are the ones where everything happens at once. In a fractured carbonate, an interval can carry conductive and resistive fractures crossing one another and crossing the bedding, all projected onto the same unwrapped strip as overlapping sinusoids. Ask a classical edge-and-line pipeline to interpret that interval and it does not fail loudly — it fails quietly, returning a thicket of line segments that fit no coherent curve. In our work with a mid-sized Middle East carbonate operator, that specific failure is where the project pivoted. We replaced Hough line-fitting with a path-opening morphological operator that sweeps 100 threshold values per interval, and in one of the most complex fractured sections in the dataset it resolved three distinct fracture sinusoids where line-fitting saw only noise. That operator became the unsupervised bridge that eventually fed our supervised Detection Transformer.
Why line-fitting collapses on overlapping sinusoids
Every planar feature that cuts a wellbore — a fracture, a bedding surface — unwraps into a sinusoid on the image log. The interpreter's job is to pick each trace and recover three numbers from its shape: depth, dip, and azimuth, via the relation Amplitude * sin(0.0175 * x + Phase) + Offset, where amplitude encodes dip and phase encodes azimuth. The classical computer-vision recipe for picking those traces is well-worn: impute the inter-pad gaps in the binary wireline log file image, run multi-Otsu thresholding to separate feature from background, clean up with morphological erosion / dilation / area-opening, detect edges with Canny, and then run a probabilistic Hough transform (HoughLinesP, Canny(200, 255), rho 1, theta π/180, threshold 30) to extract straight edge segments that a curve-fit can stitch into a sinusoid.
On a clean, isolated bedding plane this works. On a single, well-separated fracture it works. The recipe breaks the moment sinusoids overlap — and a Middle East carbonate is built out of exactly those moments.
Where the pipeline quietly breaks
Hough finds straight segments, not curves. When one sinusoid spans two analysis windows, or when several traces cross inside a single window, the segment population stops describing any one curve. The least-squares fit then averages incompatible evidence and lands on a sinusoid that matches none of the real fractures.
We saw this concretely in window-size experiments. Conventional fitting is sensitive to how the image is partitioned: narrow the window and a single sinusoid gets split across two of them, so its evidence is severed; widen the window and multiple curves crowd in, so the fit is poisoned by traces that belong to different fractures. Overlapping the windows helps at the margins but cannot resolve the core problem — a least-squares line-fit has no native way to say these segments belong to fracture A and those to fracture B. That is an assignment problem hiding inside what looks like a curve-fitting problem, and the Hough stack has no machinery for it.
There is a second, more physical liability. Each high-resolution borehole image log in this dataset is roughly 690,000 × 360 pixels and about 1.5 GB, with depth resolution near 3 cm per pixel. Erosion and dilation — the morphological cleanup that makes Hough tractable — are exactly the operations that erase low-contrast traces. The faint resistive fractures that matter most in a tight carbonate are the first casualties of the cleanup step that the line-fitting pipeline depends on.
Path opening: morphology that follows the curve
Path opening is a morphological operator that keeps the structures a line-fit throws away. Instead of asking is there a straight segment here, it asks is there a connected, slowly-bending path of bright (or dark) pixels long enough to be a real feature. It is built for elongated, curved structures — precisely the geometry of a fracture sinusoid on an unwrapped log. We used the unbiased path-opening formulation of Asplund & Hendriks (2016), implemented as a path opening over an upper skeletonisation of the thresholded image with weighted adjacency graphs linking the surviving pixels into candidate traces.
The engineering matters as much as the mathematics. The operator was first written in C++ for speed, then ported into the Python pipeline (via a MATLAB/mex bridge in the early iterations) so it could run inside the same DataOps environment as the rest of the borehole-image-log workflow. That choice — a fast native core wrapped in a Python orchestration layer — is what made the next idea affordable.
The next idea was to stop choosing a single binarisation threshold and instead sweep them. A path opening is only as good as the binary image it runs on, and on a complex interval there is no single threshold that exposes every fracture: the value that reveals a sharp conductive trace washes out a faint resistive one. So rather than commit, the operator sweeps 100 threshold values across a single 2-metre interval, runs the path opening at each, and aggregates the surviving paths into a candidate set of sinusoids. The cost of that exhaustiveness is about two minutes of compute per 2-metre interval — cheap, because the C++ core is fast and the sweep is embarrassingly parallel.
This is the unsupervised analogue of the assignment idea that later defined our supervised model. Sweeping thresholds and aggregating connected paths lets multiple overlapping sinusoids each survive in the threshold band where it is most visible, instead of forcing a single global decision that can only ever describe one of them. The path operator does not delete a real fracture for being too close to its neighbour — and that is precisely the failure mode of the line-and-suppress stack it replaced.
The interval where it earned its place
The proof was a section flagged by the operator's geoscientists as one of the most heavily fractured in the well — the kind of interval where a manual interpreter spends a disproportionate share of their time and where the conventional pipeline had returned an unusable scatter of segments. Across the 100-threshold sweep, the path-opening operator resolved three distinct fracture sinusoids in that single complex zone. Where line-fitting had averaged the overlapping evidence into noise, the morphological operator separated the traces, and each surviving path was handed to the same Amplitude * sin(0.0175 * x + Phase) + Offset curve fit to recover its dip and azimuth.
Before
Noise on overlap
Otsu → erosion/dilation → Canny → Hough line-fit: segments average to a sinusoid that matches none of the real fractures; faint resistive traces erased by morphological cleanup
After
3 sinusoids resolved
Path-opening over upper-skeletonised image, 100-threshold sweep, ~2 min per 2 m interval — overlapping traces each survive in their own threshold band
3 distinct fractures recovered where line-fitting saw none
Two honest caveats travel with that result. First, the operator detects clearly-visible fractures reliably but still misses partial traces and the lowest-contrast features; in some sections it also picked up faults and fractures that were absent from the geoscientists' ground truth, which is as much a flag for re-inspection as a false positive. Second, the recovered dip and azimuth track the manual picks broadly but not tightly — sign flips and large azimuth deviations remained on the hardest fractures. Path opening solved the detection problem on overlap; it did not, on its own, solve the geometry-precision problem. That gap is exactly what motivated the supervised pivot.
The bridge into supervised detection
The path-opening work paid a second dividend that does not show up in any single accuracy number: it produced the conceptual and data scaffolding for the supervised model that followed. The reservoir interval we started from was brutally sparse — 32 fracture sinusoids across 236 image patches, only 19 of which contained a sinusoid at all. No transformer trains on that. The unsupervised pipeline gave us the patch geometry (an 800-pixel, 2.2-metre patch captures more than 95% of fracture and bedding sinusoids), the labelling rubric, and the early picks that seeded a geometry-preserving augmentation strategy lifting the corpus past a tenfold increase.
It also taught us the right way to think about overlap. The supervised successor — a DETR-derived detector trained on high-resolution borehole image logs from two different microresistivity imaging tools across 14 vertical wells — reframes detection as one-to-one set prediction with Hungarian matching, so that two overlapping fractures are assigned to two different queries by construction. The intuition behind that architecture was sharpened on this interval: the unsupervised threshold sweep had already shown that the cure for overlap is to give each trace its own channel to survive in, rather than forcing a single global decision and suppressing the rest. We carry that lesson into engagements with operators across the Middle East and the United States, where the same overlap-dominated intervals recur in different carbonates.
What the unsupervised stage actually delivered
A working detector for the hardest intervals at a tractable cost — roughly two minutes of compute per 2-metre interval across the full 100-threshold sweep — and, just as important, the patch geometry, labelling rubric, and design intuition that made the supervised Detection Transformer trainable on a tiny, overlap-heavy carbonate dataset.
Why this generalises
The architectural lesson is not Middle East-specific. Anywhere geological features overlap in a 2-D image — densely fractured carbonates, faulted intervals, cross-cutting bedding — the assignment problem dominates, and a method that lets each feature survive in its own representational channel will out-behave one that commits to a single global threshold and a least-squares line-fit. Path opening is the classical-CV way to do that; bipartite-matched set prediction is the deep-learning way. The same idea runs through both, and the unsupervised operator is what made the supervised one trainable when the labelled data simply was not there yet.
Why path-opening morphology beats line-fitting on overlapping fractures
- Hough line-fitting solves a curve problem with straight segments; when sinusoids overlap or span window boundaries, the least-squares fit averages incompatible evidence into noise, and the morphological cleanup it depends on erases the faint resistive traces that matter most.
- A path-opening operator over an upper-skeletonised image, sweeping 100 binarisation thresholds per 2-metre interval (~2 min of compute), resolved 3 distinct fracture sinusoids in a complex carbonate zone where line-fitting saw none — each overlapping trace survives in the threshold band where it is most visible.
- Path opening solved detection but not geometry precision, which is exactly why it became the unsupervised bridge: it supplied the patch geometry, labelling rubric, and overlap-as-signal intuition that made the supervised Hungarian-matched Detection Transformer trainable on a sparse, overlap-heavy 14-well dataset.
References
-
Asplund, T. & Hendriks, C. L. L. (2016). A faster, unbiased path opening by upper skeletonization and weighted adjacency graphs. IEEE Transactions on Image Processing. https://doi.org/10.1109/TIP.2016.2587340
-
Carion et al. (2020). End-to-End Object Detection with Transformers (DETR). ECCV 2020. https://arxiv.org/abs/2005.12872
-
Path-opening sweep counts (100 thresholds, ~2 min per 2 m interval), the three-sinusoid complex-interval result, patch geometry, and borehole-image-log characteristics are derived from internal validation on a 14-well Middle East carbonate dataset acquired with two different microresistivity imaging tools; data and code withheld under operator confidentiality.