# R32 · DIAMORPH on six atlas-source sanity checks

## Source-domain control · 2026-12-01

R30 found low exact-name agreement between the DIAMORPH species classifier and two small previously inspected UDE crop sets. Is the model and code mapping at least functioning on examples from the source dataset it was trained on? This is a **sanity check**, not an independent accuracy test: these examples may occur in the classifier's training or validation data, and their selection was informed by earlier work.

The [DIATLAS dataset](https://doi.org/10.5281/zenodo.16260887) supplies `diatoms.csv`, images and an atlas README. The CSV describes source image scale as **micrometres per 100 pixels**. Retrieve its 2.8 MB index and 98 KB README and check their published MD5s (`be2fc6d2ee5b568869725852e340dd1a` and `fa41c3ee33b6f849c08244641faf6767`). Preselect six codes `ADMI`, `NGRE`, `APED`, `HVEN`, `FSAP`, `AAMB`; these include names or outputs already encountered during development. For each code, select the first lexicographic image index entry with a nonempty scale and `connective=False`. Retrieve only those six image members from the 1,115,209,674-byte ZIP using bounded HTTP ranges and ZIP CRC validation. Source-member paths, pixel scales and image SHA-256s are included in [the results](/results/pilot/diamorph-atlas-controls/controls.json).

Prepare each image using its indexed physical scale divided by 100, the R28/R30 resize-and-pad procedure, and conversion to grayscale, as the author's preprocessing script does. The source data may contain minor color content. Compare the grayscale inputs against the inspected [author's square-pad script](https://raw.githubusercontent.com/ai4os-hub/diamorph-classification/main/scripts/square-pad.py): all six are pixel-identical. This does not establish parity with the complete remote application or with other image conditions. The temporary weights have SHA-256 `4d3f2fd10c72b04480c56856f3513fd46761f52fb4da6ee187bc90dc0d3a3e54`; their release and license are recorded in R28.

The top class code matched the atlas CSV's `species_code` for **6/6** selected images; all six are also in the top five. [Inspect source and prepared images](/results/pilot/diamorph-atlas-controls/) and [all top-five outputs](/results/pilot/diamorph-atlas-controls/controls.json). This gives a useful check of the downloaded checkpoint, code mapping and local preprocessing on a handful of source-domain images. It does **not** show unseen-specimen accuracy, explain the UDE mismatch, validate transfer to Academy images, resolve taxonomy synonyms, establish open-set rejection, or support the 95%/60% targets. In particular, high scores can reflect training or source-image familiarity; we have not determined split membership or biological independence. The UDE images are scan-derived, focus-stacked crops with different optics and processing. Overlap and partial-valve performance were not tested here.

**Credits.** DIATLAS v1, Galinier, Villefourceix-Gimenez, Bojic, Wetzel, Fix, Morin and Laviale, [Zenodo DOI 10.5281/zenodo.16260887](https://doi.org/10.5281/zenodo.16260887), CC BY 4.0. The displayed dataset images are extracted atlas examples. Sources 5 and 14 are Asconit Consultants' Île-de-France (2014) and Languedoc-Roussillon (2013) atlases; source 4 is Peeters and Ector's Bourgogne atlas, Volume 3 (2020); the DIATLAS README provides full references and page identifiers.

**Next.** Obtain or reconstruct exact source train/validation grouping and test on genuinely separate atlas specimens and UDE slides, with taxonomic names reconciled. Explore domain adaptation to Academy optics and focal stacks without tuning on the final held-out set. Pair this with expert-reviewed overlap and partial annotations, open-set cases and field-level end-to-end evaluation.

Reproduce by restoring `/tmp/diatlas-diatoms.csv`, `/tmp/diatom-diatlas-controls/selection.json`, its six images, and the temporary model checkpoint. `diatom_pilot/fetch_diatlas_controls.py` performs the bounded download; `YOLO_CONFIG_DIR=/tmp/diatom-yolo-config MPLCONFIGDIR=/tmp/mpl-diatom /tmp/diatom-research-venv/bin/python diatom_pilot/diamorph_atlas_controls.py` runs inference. Run `diatom_pilot/diamorph_atlas_parity.py --author-script /tmp/diamorph-source-square-pad.py` to compare the inspected external script; it verifies the pinned hash before executing it.
