# R34 · Mask-derived orientation inside public cutouts

## Conditional 18-crop development test · 2026-12-01

R33's promising oriented crops used human reference rectangles. This test asks whether a predicted MobileSAM mask can provide an orientation without looking at that rectangle. Reuse the same 18 already examined, annotated UDE cutout images, DIAMORPH classifier, 0.09 µm/pixel source scale and source-code name matching. The existence and boundaries of each cutout **already come from a human annotation**: neither prompt strategy locates diatoms in a full field. A center point is simply the cutout center, not an expert click and not guaranteed to be on the intended specimen.

For each entire cutout, run MobileSAM with either (a) a box covering the whole image or (b) one positive point at the image center. Fit the minimum-area rectangle to **all** pixels in the resulting mask, add a 5% short-side margin, warp the original image into that orientation, and run DIAMORPH at the physical source scale with the same preprocessing as R33. There is no segmentation ground truth here; the fitted rectangle can be determined by background, isolated noise, a second diatom or a merged group. The reference-oriented column uses R33's human annotation and is an oracle comparison. Missing or invalid masks count as unmatched in the summary; none occurred in this sample.

| Preparation on 18 selected public cutouts | Exact top genus | Exact top species |
|---|---:|---:|
| Original cutout | 4 / 18 | 2 / 17 |
| Human rectangle orientation (R33) | 13 / 18 | 7 / 17 |
| Predicted mask, whole-cutout box prompt | 4 / 18 | 2 / 17 |
| Predicted mask, center-point prompt | 9 / 18 | 6 / 17 |

There are 17 rather than 18 species-labeled cases because one UDE species value is `None`; all have genus labels. The box prompt produced masks covering at least 95% of the cutout in 16/18 cases, versus 2/18 with the center point. This fraction is an image-area diagnostic, **not mask IoU or a segmentation accuracy measure**. In the center-prompt variant, all four baseline genus matches stayed matches and five more became matches; both baseline species matches stayed matches and four more became matches. Other predicted names and masks changed as well. [View center-point examples](/results/pilot/diamorph-mask-orientation/) and compare [box-prompt examples](/results/pilot/diamorph-mask-orientation/comparison.jpg) with [center-prompt examples](/results/pilot/diamorph-mask-center/comparison.jpg). The first four cases in source order are shown, not selected for success.

These tiny, balanced, repeatedly examined public crops were chosen for earlier development and have no Academy labels. Exact-name comparisons ignore taxonomy synonyms; some cutouts contain background or neighbors, and model training overlap is unknown. The center-point output is conditional on an annotation-derived crop, not a complete detector/segmenter/classifier. It does not establish performance on real overlap groups or partial valves, does not measure review burden, and cannot demonstrate the 95% genus or 60% species targets. The stronger human-rectangle result in R33 was not reproduced by this center-prompt rule on the same six-slide selection.

**Next.** Try candidate-derived points and mask component selection on full-field model proposals; preserve separate overlapping hypotheses and test the failure modes where a single point lands on background or a neighbor. Use expert-reviewed local masks and independent samples to score localization, complete crossing groups, fragmentation and end-to-end taxon identification. Freeze any prompt, component and orientation rule before evaluating a held-out test set; provide an abstain/uncertain path when geometry is ambiguous.

Reproduce with `YOLO_CONFIG_DIR=/tmp/diatom-yolo-config MPLCONFIGDIR=/tmp/mpl-diatom /tmp/diatom-research-venv/bin/python diatom_pilot/diamorph_mask_orientation.py --prompt box` and the same command with `--prompt center`. Both require the R33 output, public source crops and the temporary `/tmp/mobile_sam.pt` and DIAMORPH weights. Their hashes are recorded in the respective `diagnostic.json` files. Model and dataset provenance are in R7 and R28.
