# R31 · DIAMORPH input-preparation controls

## Paired development comparison · 2026-12-01

R30 found poor exact-name agreement between the DIAMORPH species classifier and two already-inspected UDE crop subsets. To probe possible input mismatch, reuse the exact same 79 crops, 0.09 µm/pixel source scale, model and exact-name scoring. Compare the source-recommended preprocessing with three deliberately simple alternatives; this is exploratory development after observing R30, not a locked confirmation test.

- **Author:** resize to 0.1 µm/pixel, make the long side vertical, center-crop if needed, flip and seamlessly blend into a 512 × 512 mean-color canvas. It matched the author script on these inputs in R30.
- **Direct mean:** same resize, orientation, center crop and flip, but paste the pixels onto the mean-color canvas without seamless blending.
- **Fit full:** direct mean method, except that images larger than 512 pixels are additionally scaled down to fit, preserving more of the crop but changing physical scale. It equals direct mean for images that already fit.
- **Inverted author:** invert every pixel of the author-prepared image. This is an artificial contrast polarity control, not a physically validated microscopy transformation.

| Previously inspected subset | Preparation | Top-1 exact genus | Top-1 exact species |
|---|---|---:|---:|
| 18 selected crops | Author | 4 / 18 | 2 / 17 |
| 18 selected crops | Direct mean / fit full | 4 / 18 | 2 / 17 |
| 18 selected crops | Inverted author | 10 / 18 | 3 / 17 |
| 61 crops from one slide | Each of the four | 0 / 61 | 0 / 59 |

All four original genus matches in the 18-image subset remained matches after inversion, and six other crops changed from a mismatch to a match; this paired count is not an independent test. Relative to the author preparation, the top **species code** changed for 11/79 crops with direct mean, 21/79 with fit-full, and 33/79 with inversion. Some names and model outputs changed even where aggregate match counts did not. Nineteen prefix crops were originally too large for the input frame. Fitting the full crop changes their scale, while direct paste changes the boundary method; neither isolated control increased exact-name matches on this particular prefix.

The [illustration](/results/pilot/diamorph-input-controls/) shows the four prepared inputs and top codes for the first crop of each subset, chosen by order rather than outcome. [Per-crop results](/results/pilot/diamorph-input-controls/controls.json) include model outputs and raw names. The comparison uses exact strings, not expert-reconciled taxonomy; 30 of 76 source species labels have no exact name in the model vocabulary, and spelling or synonyms can affect results. The 61-image prefix comes from one slide and is nonrandom; all images have been examined or used during development. Neither the 10/18 inversion result nor the zero-match result estimates Academy performance or establishes a good preparation for deployment. These are cropped public specimens; detection, masks, actual overlapping instances, classification abstentions and full pipeline performance remain untested.

**Next.** Check preprocessing against actual DIATLAS training images and data-loading settings, reconcile likely taxonomy mismatches, and investigate domain differences with a separately sampled set. Fix a single preprocessing choice and any validation-selected augmentation before a held-out expert Academy test. Also test actual labeled partials and overlapping objects and report misses and abstentions against the 95%/60% goals. Do not silently promote inversion based on this small selected sample.

Reproduce with `YOLO_CONFIG_DIR=/tmp/diatom-yolo-config MPLCONFIGDIR=/tmp/mpl-diatom /tmp/diatom-research-venv/bin/python diatom_pilot/diamorph_input_controls.py` after generating the R30 results and restoring its inputs. The baseline is read from R30 and checked against the local model hash; all alternatives are run on the same source crop. UDE images are CC0 and credited in R7; DIATLAS/model provenance and licensing are documented in R28.
