# R28 · DIAMORPH specialist species-classifier preview

## Local exploratory inference · 2026-12-01

[DIAMORPH's classification project](https://github.com/ai4os-hub/diamorph-classification) publishes a YOLOv8 classification checkpoint trained on the [DIATLAS French freshwater atlas](https://doi.org/10.5281/zenodo.16260887), not on the Academy scans. The [release](https://github.com/ai4os-hub/diamorph-classification/releases/tag/v2) reports strong validation results on its own atlas split, but those numbers do not measure performance on this project, overlapping valves or unknown taxa. The release text describes 548 species classes; the downloaded checkpoint exposes **549 class codes**, all of which map to nonempty species entries in the DIATLAS taxon-code CSV. Resolve that discrepancy and reconcile names with the Academy's taxonomy before using the model for identification.

Download the release's `species_yolov8l_best.pt` (73,996,344 bytes) to `/tmp/diatom-diamorph-species-v2.pt`; the retrieved file SHA-256 is `4d3f2fd10c72b04480c56856f3513fd46761f52fb4da6ee187bc90dc0d3a3e54`. This is a locally recorded hash, not an independently published checksum. The DIATLAS taxon table at `diatom_pilot/data/diatlas-taxonomic-code.csv` has source-record MD5 `63af9d3c482cd49638d95a331c47f74a` and SHA-256 `647047d5bbb5eb4b3520ccaa1d573f665d62086d3c6db1f2843f1dab005a4a17`. The dataset is CC BY 4.0; credit Galinier, Villefourceix-Gimenez, Bojic, Wetzel, Fix, Morin and Laviale, DIATLAS v1. The model checkpoint identifies AGPL-3.0, as does the [source repository](https://github.com/ai4os-hub/diamorph-classification). Confirm the terms of every dependency before deployment.

The source model's [metadata](https://raw.githubusercontent.com/ai4os-hub/diamorph-classification/main/ai4-metadata.yml) requests 512 × 512 grayscale inputs at 0.1 µm/pixel. The [source preprocessing script](https://raw.githubusercontent.com/ai4os-hub/diamorph-classification/main/scripts/square-pad.py) describes scale normalization, orienting the long side vertically, a flip and seamless mean-color padding. The local preview reproduces that order, with independent X/Y scale adjustments for the very slightly different calibrated pixel dimensions in our scan. Exact runtime and preprocessing parity with the authors' deployment is unverified. Input images are the six detector-box crops from the prior pilot field, not expert-confirmed single valves; some contain other material or clipped objects. The model is loaded with PyTorch's weights-only loader and an explicit class allowlist, then run on CPU.

**Result.** The model generated five ranked taxon codes for every crop; [view the input crops, padded inputs and four highest scores](/results/pilot/diamorph-diagnostic/) or [download all scores](/results/pilot/diamorph-diagnostic/preview.json). The six crops have no expert-confirmed names, so none of these are verified identifications and no genus/species accuracy can be calculated. As a basic forced-choice control, three uniform gray images also received species labels; their top scores were approximately 0.058, 0.054 and 0.091. These controls show forced naming of blank inputs, but three blanks do not establish an unknown-rejection threshold. The displayed scores are model outputs, not calibrated probabilities for the Academy domain. This preview is not integrated as an automatic taxonomic decision or added to the review flow.

**R29 follow-up.** For these six source crops, the preview's grayscale preprocessed images matched the author's published preprocessing script pixel-for-pixel; this does not establish parity for other images or the complete service. Rotations and synthetic stripes changed several top predictions. All 549 checkpoint codes map to distinct species names in the current table, so duplicate names do not explain the release's stated count of 548. [Read the follow-up](/research/R29.md).

**Next.** Check deployment parity against the authors' preprocessor, clarify the class-count and taxonomy mapping, then evaluate fixed preprocessing and independent source-separated external specimens with known physical scales and independently reviewed Academy fields. Include unknown and similar taxa, clipped/overlapping crops, focus-plane variations and debris; calibrate any abstention threshold on a separate split. Only compare the model to the user's 95% genus and 60% species targets on a predeclared, representative end-to-end test with misses and abstentions counted under an expert-agreed protocol.

Reproduce with `YOLO_CONFIG_DIR=/tmp/diatom-yolo-config MPLCONFIGDIR=/tmp/mpl-diatom /tmp/diatom-research-venv/bin/python diatom_pilot/diamorph_preview.py` after restoring the temporary checkpoint. The experiment's inputs and taxonomy table are local; no Academy imagery was sent to an external service.
