# L16 · Focus-composited input for detection

## Four-field construction check · 2026-12-01

**Question.** Could a rough all-in-focus rendering help an existing detector find valves whose sharpest structures lie on different focal planes? This is a long shot: composites can create misleading features, and their impact on crossing instances and identification is unknown.

**Method.** Read every Z plane for each of the four practice fields. For each pixel, choose the plane with the greatest local Gaussian-smoothed squared Laplacian response (sigma 5 pixels), and take that plane's pixel value. Run the same frozen diatom-trained YOLO detector at confidence 0.05 and input size 768 used for the initial-plane R3 baseline. Do not register planes. Save the composite, the full per-pixel zero-based Z-index image, and model boxes. [View the comparisons](/results/l16/) and [download coordinates](/results/l16/focus-fusion.json).

**Observations.** The initial planes produced 9 boxes with 8 one-to-one assignments to provisional user points; the composites produced 14 boxes with 11 assignments. By field, assignments changed 1→1, 1→0, 1→3 and 5→7. Larger boxes can contain several points but receive at most one assignment. The 54 possible-diatom marks are nonexpert and incomplete, and their count is not a denominator for recall. Extra boxes can include duplicates, merged objects or debris. This is not a controlled comparison at equal false-positive burden, nor an estimate of detection or classification accuracy. The full-stack composite uses more input than one plane.

**Limitations and decision.** The chosen Z index is a local contrast proxy, not measured object depth. Adjacent pixels can come from different planes, producing seams or blended-looking structure; unregistered planes and nearby high-contrast debris may distort apparent frustule detail. Do not use the composite alone to verify diagnostic features, judge valve boundaries, or infer physical layering. Investigate as an optional proposal source, keeping all raw planes and their Z index available. On fresh expert-reviewed systematic fields, compare against independent per-plane linking (R5) and raw views at a matched false-positive/review budget, including partials, crossing pairs, artifacts and whether a reviewer can reject hallucinated details. An objectively better-looking composite is not sufficient.

**Reproduce.** `YOLO_CONFIG_DIR=/tmp/diatom-yolo-config MPLCONFIGDIR=/tmp/mpl-diatom /tmp/diatom-research-venv/bin/python research/l16_focus_fusion.py` requires the original OME-TIFFs, R3 predictions and detector checkpoint at `/tmp/diatom-detector.pt`. All image values in `focus-index-*.png` are raw zero-based Z indices, not display colors.
