# L3 Learning from focal-plane pairs

Status: exploratory frozen-encoder diagnostic; no embedding model has been trained. A [diatom self-supervised learning study](https://pmc.ncbi.nlm.nih.gov/articles/PMC12002600/) investigates reducing annotation needs in taxonomic classification. The [UDE dataset paper](https://doi.org/10.1093/gigascience/giae087) also reports masked-image reconstruction followed by classification. Those results motivate domain adaptation; they do not establish that treating focal planes as interchangeable helps with these stacks.

## Frozen features across focal planes · 2026-11-30

Using the existing ImageNet ResNet-18 and 96 × 96 pixel windows centered on provisional crossing marks, compare the marked plane to the same XY one plane away, the farthest available plane, and the nearest other same-plane mark at least 150 pixels away. One of 14 crossings has no eligible comparison, leaving 13 selected cases. Median cosine similarities were 0.925, 0.724, and 0.728 respectively. The adjacent-plane value exceeded the other-location value in 13/13 cases; the far-plane value did so in 7/13. [Inspect all comparisons](/results/l3/) and [download measurements](/results/l3/focus-feature-results.json).

This is a stability diagnostic, not a measurement of taxonomic or specimen identification. Matching positions share stationary background and can include several overlapping specimens; other marked locations can also contain the same taxon. Near-edge windows are shifted to remain in the field, and samples come from just four provisionally annotated fields. Cosine values are correlated, not independent benchmark observations. The farthest-plane comparison is a stress test and varies in Z separation. No focus-pair training was performed. The result supports testing nearby-plane pairs but also warns that broad focus invariance needs specimen-level validation.

### Center-versus-surrounding ablation

To probe whether the shared surroundings could drive the adjacent-plane similarity, replace either the central 48 × 48 pixels or the surrounding pixels of each 96 × 96 crop by that crop's median intensity, and repeat the 13 paired comparisons using the same encoder. The median margin between adjacent-plane and other-location cosine similarity is 0.205 for the whole crop, 0.108 for the central square alone, and 0.158 for the outer ring alone. Every margin is positive in each condition. [View all ablated inputs](/results/l3/background-control.html) and [download the paired measurements](/results/l3/background-control.json).

This shows that the outer region carries enough information to distinguish these matched locations; it does **not** prove that background alone explains the original result. The ring can contain diatom structure or other valves, and the center can contain background; the square and median-filled boundaries introduce artificial features. The two ablations retain different amounts of image area, so their magnitudes cannot be interpreted as a clean attribution. Expert delineations, matched-background controls, and independent slides are needed before using this as evidence of specimen-level invariance.

L2 shows that local contrast peaks can differ from the field peak, which makes paired views worth exploring. A crop at fixed XY can contain two overlapping valves whose visibility changes with Z. Making all planes equivalent could suppress precisely the focal detail an analyst needs. Treat this as an empirical hypothesis.

Compare three encoders under the same labeled training budget: frozen DINOv3, an adapter trained on same-plane augmented pairs, and an adapter trained on nearby-plane pairs at the same XY. Exclude validation and test samples from all adaptation. Stratify retrieval on isolated and overlapping specimens. Measure whether the same specimen stays close across planes, then check taxon retrieval and the ability to distinguish adjacent objects. A nearest-neighbor gallery should expose cases where background dominates. Collect a small expert-labeled cross-focus set before interpreting taxonomic performance.

Promising alternative if invariance hurts: preserve separate plane embeddings and combine them with an attention mechanism or rank planes by diagnostic quality. That could retain the features that appear in only one focus plane.
