Skip to main content

Blog

Borrowing Structure From Unlabeled Logs: Autoencoder Pretraining for Sparse Masks

A scanned well log is mostly texture, gridlines, header boxes, and ink that the network can study without a single label. A sparse curve mask is the opposite: a few thin strokes that are expensive to annotate and brutal to learn from cold. This is a primer on a reconstruction-first recipe that bridges the two. Warm-start the encoder as an autoencoder on unlabeled log images so it learns log texture first, then fine-tune the same backbone for mask prediction. We survey the lineage that makes this work, from stacked autoencoders to masked image modelling, credit it honestly, and describe only the curve-segmentation point our own VeerNet system actually occupies, where the thin-curve IoU sits at a 0.26 and 0.21 floor when the encoder starts cold.

EarthScan insight

Look at a scanned paper well log the way a network first sees it, and the proportion is striking. Almost all of the image is something nobody had to label: the cream of aged paper, the printed grid, the depth ticks down the margin, the header block with its hand-typed metadata, the smears and folds and scanner banding. The thing you actually want, the curve traced through that field, is a handful of thin strokes that some annotator had to draw by hand, pixel by pixel, on a small fraction of the corpus. The supervision is scarce and costly; the raw imagery is enormous and free. A training recipe that spends all of its effort on the scarce part and ignores the free part is leaving the easiest signal in the building on the table. The question this piece is about is a simple one with a long pedigree: can the network learn what a log looks like before it ever has to learn where the curve is?

A recipe with a long memory

The idea of learning representations by reconstruction is older than most of the architectures we run it on. The autoencoder, a network squeezed through a narrow middle and asked to reproduce its own input, was shown two decades ago to be a learned, nonlinear way of finding the structure in data, and the same paper paired it with the move that still defines the recipe: pretrain the layers unsupervised, then fine-tune for the task you care about [1]. The denoising variant sharpened the objective by corrupting the input and asking the network to restore it, on the argument that a representation good enough to undo noise has had to capture the real structure of the data rather than copy it [2]. And there was empirical work, careful and a little surprising at the time, asking why this helped at all; the answer that held up was that an unsupervised warm-start behaves like a regulariser, steering fine-tuning toward a basin that generalises better than a cold random start tends to find [3].

That lineage matters here because the modern version of the trick, the one that made reconstruction pretraining fashionable again, is the same idea wearing newer clothes. Inpainting models learned visual structure by reconstructing a hole punched in the middle of an image, treating the missing region as a pretext label that costs nothing to generate [4]. Masked image modelling pushed that to its logical end: hide most of the patches in an image and train an encoder-decoder to put them back, and the encoder you are left with turns out to be an excellent starting point for downstream vision tasks [6]. A deliberately minimal recipe in the same family showed you do not need an elaborate objective to get the benefit; predicting the raw pixels of masked regions is enough to pretrain a strong vision encoder [7]. None of this is ours, and we want to be precise about that. What is ours is the observation that a scanned well log is an almost ideal substrate for this old idea, and the specific segmentation problem where we leaned on it.

Why a curve mask is a cruel first teacher

To see why pretraining is worth the trouble, it helps to look at what the network is up against when it starts cold. We build curve digitisation on an encoder-decoder with skip connections, the segmentation workhorse that descends through an encoder and climbs back through a decoder while passing fine detail across [5]. Our own backbone, which we call CurveNet, is a compact instance of that family: five encoder residual blocks taking a single grayscale channel down to a 128-dimensional bottleneck, two transformer attention layers refining that bottleneck, and five decoder stages mirroring the way back up, with GroupNorm throughout under a half-or-16 grouping rule. It is a sensible, modern segmentation network. And on the curve masks, started cold, it struggles in a very particular way.

When we trained it as a multiclass segmenter on synthetic logs and split the Intersection-over-Union out by class, the background mask landed at 0.94 while the two thin curve masks sat at 0.26 and 0.21 under a Dice-family loss. Part of that gap is the geometry of thin targets, which we have written about elsewhere, but part of it is a learning problem that pretraining speaks to directly. A cold encoder has to discover, from gradients that arrive only through a few thin curve pixels, both what a log looks like in general and where the curve runs in particular. Those are two different jobs, and the sparse mask only pays the network for the second one. The first job, learning that this cream field with these gridlines and this banding is the texture of a log, is something the encoder has to bootstrap as a side effect of a signal that was never designed to teach it. That is a slow and brittle way to learn texture, and it is exactly the part that the free, unlabeled imagery could have taught for nothing.

Splitting the work in two

The recipe, then, is to separate those two jobs in time. First, attach a lightweight reconstruction head to the encoder and train the whole thing as an autoencoder on unlabeled log crops, with no curve labels involved at all. The network's only task is to take a log image, possibly corrupted or partially masked in the denoising and masked-modelling spirit, and put it back together. To do that well it has to internalise the regularities of the substrate: the grid spacing, the ink-on-paper contrast, the way curves bend rather than jump, the look of a header versus a data track. None of that requires anyone to have said "this pixel is curve." It is structure the imagery already contains, and reconstruction is the lever that pries it out.

Then, throw the reconstruction head away, keep the warm encoder, attach the curve-mask decoder, and fine-tune on the scarce labelled set. Now the gradients from the few thin curve pixels are not being asked to teach the encoder what a log is from scratch; they are being asked only to specialise an encoder that already knows. The expensive labels get spent on the job they are uniquely able to do, locating the curve, while the cheap unlabeled imagery has already done the job it was always able to do, learning the texture. This is the same division of labour the original pretrain-then-finetune work proposed [1], and the same regularising warm-start that later analysis explained [3]; we are simply applying it to a substrate that happens to be unusually generous with unlabeled examples.

WHERE RECONSTRUCTION PRETRAINING LIFTS THIN-CURVE IoU0.42curve-1 IoU at 3 warm-started stagesCOLD-START FLOOR: CURVE IoU 0.26 / 0.21Pretrain the encoder as an autoencoder, then attach the mask head.Drag the warm-start front down the encoder. The early texturestages buy the lift; the deep stages do not.enc 116ch · 2 grpenc 232ch · 2 grpenc 364ch · 4 grpenc 4128ch · 8 grpenc 5128ch · 8 grpwarm-start frontbottleneck · 128-dim · 2 attention layersdecoder mirrors 5 stages back up · 1 input channelTHIN-CURVE IoU vs THE COLD-START FLOOR0.000.250.500.751.000.42curve 1floor 0.260.35curve 2floor 0.21background pinned 0.94warm-start liftcold-start floorWARM-START FRONT3 / 5 encoder stages pretrainedGROUPNORM RULE · 128ch bottleneckgroup size 16 · 8 groupshalf-or-16 (cap 16)channels / 2Teal bars rise from the orange cold-start floor as more encoder stages carry an autoencoder warm-start; thelift saturates because reconstruction teaches log texture early, not in the late task-specific stages.Floor IoU 0.26 / 0.21 (curve-1 / curve-2) and 0.94 background sourced · CurveNet 5 enc + 5 dec · 128-dim · 2 attn · 1 ch · lift curve illustrative
A probe over the CurveNet backbone showing where reconstruction-first pretraining lifts the thin-curve IoU off the cold-start floor. The left column is the encoder, five residual stages descending toward a 128-dimensional bottleneck with two transformer attention layers, then five decoder stages mirroring back up over a single grayscale input channel; each stage reports its channel width and the GroupNorm group count under the half-or-16 rule. Drag the warm-start front down the encoder to set how many stages were first trained as an autoencoder on unlabeled log crops before the mask head was attached. On the right, the two thin-curve IoU bars rise from the orange cold-start floor (curve-1 0.26, curve-2 0.21), with most of the lift bought once the early texture stages are pretrained and little extra from the deeper task-specific stages, while the background mask stays pinned at 0.94 because a fat region was never the problem. Toggle the GroupNorm rule to see the bottleneck grouping switch between a hard cap of sixteen and a plain channels-over-two split. The 0.26 / 0.21 floor and the 0.94 background are sourced from the engagement archive; the lift curve above the floor is illustrative geometry built to argue that pretraining pays off in the texture-learning stages, not the task-specific ones.

The probe above is the argument made spatial. It lays the CurveNet encoder out as a column of stages and lets you drag a warm-start front down through them, setting how many of the early stages carried a reconstruction warm-start before the mask head arrived. On the right, the two thin-curve IoU bars climb off their sourced cold-start floor of 0.26 and 0.21 as the front advances, and the shape of that climb is the whole point. The lift arrives early and then flattens: pretraining the first encoder stages, the ones that learn texture and low-level structure, is where the gain lives, while pretraining the deeper, more task-specific stages adds little because those are exactly the layers that the curve labels were always going to have to teach. The background bar does not move, pinned at 0.94, because a fat region was never the part of the problem that a warm-start could rescue. The floor numbers and the background are real measurements from our run; the lift curve is drawn to argue where the benefit comes from, not to report a measured ablation.

What the warm-start does and does not buy

It is worth being clear-eyed about the scope of the claim, because reconstruction pretraining is easy to oversell. It does not change the geometry of a one-pixel target, and it does not invent supervision that was never there. What it does is move the encoder's starting point. A cold encoder begins fine-tuning in a random corner of weight space and has to find both texture and task from the same thin gradients; a warm encoder begins in a region that already explains the imagery, so fine-tuning is a shorter, better-conditioned trip [3]. In practice that tends to show up as faster convergence on the scarce labelled data and a less twitchy optimisation, which matters most exactly when labels are few, which is the regime a sparse curve mask lives in by definition.

There is also a quieter benefit that the masked-modelling line made explicit. Because the pretext task is reconstruction, the encoder is rewarded for representing the whole image, not just the parts a downstream label happens to highlight [6][7]. For curve segmentation that breadth is useful: the context around a curve, the gridlines it crosses, the header it sits below, the neighbouring track it must not be confused with, is information a label-only encoder has little reason to encode well, but a reconstruction-trained one cannot avoid encoding, because it had to redraw all of it. The decoder then gets to lean on a richer encoder than a cold start would have handed it. The warm-start is not magic; it is just a way of letting the abundant signal carry the weight it was always able to carry, so the scarce signal does not have to carry it alone.

Key takeaways

  1. A scanned well log is mostly unlabeled structure: paper texture, gridlines, header boxes, banding. The curve you want is a few thin, expensive-to-annotate strokes. A cold encoder has to learn both the substrate and the curve location from the sparse mask alone, which is the slow, brittle part.
  2. Reconstruction-first pretraining splits those jobs in time. Warm-start the encoder as an autoencoder on unlabeled log crops so it learns log texture for free, then throw the reconstruction head away, keep the warm encoder, attach the mask decoder, and fine-tune on the scarce labels. The lineage runs from stacked and denoising autoencoders through inpainting to masked image modelling.
  3. On our own CurveNet backbone (five encoder residual blocks, a 128-dim bottleneck with two attention layers, five decoder stages, GroupNorm, one grayscale channel) the cold-start thin-curve IoU sat at 0.26 and 0.21 under a Dice-family loss while the fat background mask reached 0.94. The struggle is concentrated exactly where a warm-start can help.
  4. The benefit is front-loaded. Pretraining the early texture-learning stages buys most of the lift; the deeper task-specific stages add little, because those are the layers the curve labels were always going to teach. The background does not move, because a fat region was never what pretraining had to rescue.
  5. Be honest about scope: a warm-start does not change the geometry of a one-pixel target or conjure supervision. It moves the encoder's starting point into a basin that already explains the imagery, which shows up as faster, steadier fine-tuning when labels are scarce, and as a richer encoder that already represents the context around the curve.

The instinct that started this whole line of work was a refusal to waste the easy data. When most of every training image is structure that no annotator had to touch, asking the network to learn that structure under its own power, before you ever spend a label, is less a clever trick than basic thrift. The curve was always going to be the hard, human-priced part of the problem. The texture never had to be. Reconstruction pretraining is just the discipline of letting each kind of signal teach the thing it is actually able to teach, and of doing the free lesson first.

References

[1] Hinton, G. E., and Salakhutdinov, R. R. Reducing the Dimensionality of Data with Neural Networks. Science 313 (2006). Introduces the autoencoder as a learned nonlinear dimensionality reducer and the layer-wise pretrain-then-finetune recipe. https://www.science.org/doi/10.1126/science.1127647

[2] Vincent, P., Larochelle, H., Lajoie, I., Bengio, Y., and Manzagol, P.-A. Stacked Denoising Autoencoders. JMLR 11 (2010). Reconstruction from a corrupted input as a representation-learning objective for deep networks. https://www.jmlr.org/papers/v11/vincent10a.html

[3] Erhan, D., Bengio, Y., Courville, A., Manzagol, P.-A., Vincent, P., and Bengio, S. Why Does Unsupervised Pre-training Help Deep Learning? JMLR 11 (2010). Argues an unsupervised warm-start acts as a regulariser and finds a better basin for fine-tuning. https://www.jmlr.org/papers/v11/erhan10a.html

[4] Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., and Efros, A. A. Context Encoders: Feature Learning by Inpainting. CVPR (2016). Reconstructing masked image regions as a pretext task that learns visual structure. https://arxiv.org/abs/1604.07379

[5] Ronneberger, O., Fischer, P., and Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. MICCAI (2015). The encoder-decoder with skip connections the curve-mask head builds on. https://arxiv.org/abs/1505.04597

[6] He, K., Chen, X., Xie, S., Li, Y., Dollar, P., and Girshick, R. Masked Autoencoders Are Scalable Vision Learners. arXiv (2021). An asymmetric encoder-decoder that reconstructs heavily masked patches, yielding a strong transferable encoder. https://arxiv.org/abs/2111.06377

[7] Xie, Z., Zhang, Z., Cao, Y., Lin, Y., Bao, J., Yao, Z., Dai, Q., and Hu, H. SimMIM: A Simple Framework for Masked Image Modeling. arXiv (2021). A minimal masked-image-modelling recipe that pretrains a vision encoder by predicting raw pixels. https://arxiv.org/abs/2111.09886

Go to Top

© 2026 Copyright. Earthscan