# L47 · Phase alignment against injected drift

Reuse three previously inspected R58 split-focus toy crossing scenes and three corresponding background-only scenes. Apply additional whole-frame integer translations with horizontal step 0, 2, 6 or 12 pixels per plane from the middle, vertical step half as large, for normal, artificially reduced-contrast and exactly constant images. Gaussian blur and overlay were already simulated in R58; neither focus changes nor inserted shifts are calibrated microscope optics. The original images contain local real backgrounds with unknown natural plane-to-plane behavior. [Protocol](/results/l47/protocol.json) · [registration data](/results/l47/registration.json) · [image overlays](/results/l47/).

Apply Hann-window phase correlation to each plane relative to index 2. To measure the **incremental injected shift**, subtract that image pair's phase estimate at zero injection before comparing with the known added shift. This subtraction uses the unshifted simulation as a reference and does not establish absolute real-stage displacement. At the strongest drift, all 12 nonmiddle comparisons across three textured crossing pairs had incremental error ≤1 pixel (median 0.01 px, maximum 0.09 px). Across three background-only sets, all 12 were ≤1 pixel (median 0.01 px, maximum 0.15 px). These are correlated views of six previously inspected fields. A lower-contrast simulation still uses the same content and adds no realistic sensor noise; its 12 crossing comparisons also fell within one pixel. An apparently good response to injected shifts does not establish correct absolute alignment across real focus changes.

## Candidate pooling under strong injected drift

For the three shifted crossing scenes, rerun the actual detector and MobileSAM independently on every shifted plane; do not approximate inference by merely translating old predictions. Use the same round-robin rank and mask IoU 0.8 suppression as R58. Compare candidate masks without alignment, with phase correction, and with correction by the exact known injected shift. The last method is an **oracle**, unavailable on real microscope slides. Match one-to-one to the synthetic full source masks at IoU ≥0.5.

| Pooling method | Top 10 / 6 | Top 20 / 6 | Retained candidates |
|---|---:|---:|---:|
| Unregistered | 3 | 3 | 11 |
| Phase alignment, unguarded | 6 | 6 | 8 |
| Phase alignment, response/size heuristic | 6 | 6 | 8 |
| Known injected shift, oracle | 6 | 6 | 8 |

All 12 nonmiddle normal-texture estimates passed the predeclared response ≥0.1 and displacement magnitude ≤32-pixel guard, so guarded and unguarded outputs coincided in this small set. These figures use three synthetic pairs and do not establish real-overlap accuracy. Source masks and background labeling are incomplete, and cross-plane suppression may discard real overlapping instances. [Model scores](/results/l47/mask-pooling.json) · [all 11 raw mask hypotheses and planes](/results/l47/archive-format.md).

## Guard failure and limited repair

A constant image contains no identifiable translation, yet the Hann-window correlation produced raw response about 1.01 and a near-zero shift for these controls. The original response/size guard accepted **96/96** flat-image nonmiddle observations, including nonzero injected shifts. The window itself can create a common spatial pattern; a high response is not reliable confidence. A posthoc [checked wrapper](/diatom_pilot/phase_alignment_checked.py) abstains when either input is exactly constant; it rejected all 96 flat controls and retained all 96 normal and all 96 reduced-contrast observations in this test. This is only a necessary special-case check: noisy, nearly flat or repeated textures can still produce misleading, accepted shifts. The original recorded phase estimates and prior results remain unchanged. [Guard audit](/results/l47/guard-audit.json).

**Decision.** Phase correction is a promising development cue under this controlled perturbation but cannot be treated as verified specimen identity, depth or calibrated registration. Keep unregistered masks, raw planes, per-plane coordinates and uncertainty available; test repeated texture, nonlinear motion, out-of-focus landmarks, real slide registration and independent biological samples before promoting it. The earlier L12 real-stack study already found unstable far-plane estimates.

All 11 raw automatic candidate masks, synthetic planes and source masks are preserved in three archives; [format](/results/l47/archive-format.md). Original local stack crops and source pixels remain in R58, together with calibration metadata. Gündüz source objects: Hüseyin Gündüz, [Diatom Dataset](https://www.kaggle.com/datasets/huseyingunduz/diatom-dataset), CC BY-NC-SA 4.0; cropped, resized, blurred, composited and overlaid; derivatives shared noncommercially under the same license. Backgrounds are local Academy data. `research/l47_verify_artifacts.py` replays the pooling and checks source hashes.
