# R112 · Synthetic difficult slides for segmentation training

**Status: design and development-only renderer prototype underway; R112 model training and independent evaluation have not yet been run.** [Detailed design](/research/R112_DESIGN.md) · [Source inventory](/results/r112/design/source-inventory.json) · [Prototype examples](/results/r112/) [Visual research page](/results/r112/) · [Earlier synthetic training](/results/l78/) · [Earlier crossing controls](/results/l75/)

## Idea

Build labeled synthetic microscope fields by combining individually annotated diatom images with varied backgrounds and debris, deliberately placing multiple specimens close together or crossing. We can retain a separate mask and identity for each inserted object, including objects that overlap in the image, and create partial examples at boundaries. Use the generated scenes to train instance proposals and masks, then evaluate on independently sourced real images. Preserve original planes, source coordinates and scale when applying a model to the Academy stacks, so the output can still support species identification.

This is a serious alternative to relying primarily on untrained general-purpose models and prompt/ranking tweaks. An [iMagine diatom-analysis prototype report](https://documents.egi.eu/public/RetrieveFile?docid=4087&filename=iMagine+D3.5_V1_Public_Under+EC+Review.pdf&version=1#page=28) describes constructing synthetic microscope images from diatom and debris thumbnails, pretraining on them and fine-tuning on a smaller real set. It is evidence that the approach is used in diatom research, not proof it solves our overlap problem. More generally, [SyMBac](https://pmc.ncbi.nlm.nih.gov/articles/PMC9710168/) demonstrates synthetic microscopy image generation for bacterial segmentation, with an emphasis on matching optical appearance; bacteria and its imaging conditions are not diatoms or our microscope.

## What we have already tried

[L78](/results/l78/) trained only MobileSAM's mask decoder on **24 opaque synthetic scenes made from 16 public source images**, using 64 reference-derived point-prompt examples. On two previously viewed synthetic crossing scenes with four total visible targets, automatic-prompt top-30 matching at IoU ≥0.5 changed **0/4 to 1/4**; unranked raw-mask availability changed **2/4 to 4/4**. This is a small lead, not a reliable improvement: the two newly matching raw masks were just over the 0.5 threshold, one was suppressed and the other was ranked 60th. The scenes are nonphysical opaque composites, sources and evaluation images were previously viewed, and biological independence is unknown. On 18 previously viewed fields from the separate River Menne dataset, the original and adapted methods matched **15/29 versus 14/29** source regions at 0.5, and **12/29 versus 14/29** at 0.75; annotations omit many fragments and aggregates. The local experiment does not establish improvement on real overlap, Academy slides or human-level segmentation.

[R54](/results/r54/) also used a small synthetic training set and box prompts; it did not increase matched-object counts on its small inspected crossing or real-field comparisons. Both show that a prototype is possible and why scaling and validation matter, rather than establishing that synthetic training is ineffective.

## Proposed experiment

1. **Inventory and split source specimens before rendering.** Use available public images/masks where source terms allow, retain source IDs, mask quality, physical scales and uncertain taxonomy. Audit duplicate and similar images, and split by biological sample/slide where documented; when unknown, label independence unknown. Reserve entirely separate object sources *and* background slides for each split. Do not use already consumed L75/L78 scenes as a new final holdout. Confirm dataset, model and derivative licenses for the intended use.
2. **Generate varied full fields, not just pairs.** Sample realistic object size, morphology, rotation, density, clutter and partial clipping. Explicitly vary separated controls, light and heavy crossings, near-parallel neighbors, multiple overlapping objects, fragments, edge truncation and debris. Include blank or low-density controls only where their contents are actually known. Store a deterministic recipe, random seed, source and background hashes, and each object's individual identity and transformed silhouette.
3. **Make image formation a testable variable.** Start with existing opaque and additive renderers as baselines, then explore calibrated grayscale contrast/transparency, blur and illumination variation, and depth-dependent focus across multiple planes, using real scans to guide distributions. A simple composite is a proxy, not a physical light-microscope simulation; transformed source masks describe known inserted geometry, not verified hidden anatomy or guaranteed pixel-level visibility. Keep visible-support definitions separate from underlying simulated supports, and do not invent obscured diagnostic features for species ID.
4. **Train explicit instance-aware models.** Compare the existing frozen MobileSAM proposal pipeline with synthetic-trained/adapted variants, including a detector/instance model or promptable decoder, and where practical a separate-object representation that permits overlapping projected masks. Use a fixed source/prompt/compute budget; preserve originals and aliases, and assess NMS/duplicate suppression separately. Where backgrounds contain unannotated real organisms, avoid treating them automatically as verified negatives; use known-background sources or a loss/ignore strategy whose semantics are tested.
5. **Make the comparison decide something.** Predeclare training-only synthetic, real-only if adequate labels exist, and mixed-data variants under comparable budgets. Tune only on source-separated validation. On a genuinely unused synthetic test, report distinct-object recall, precision where labels are complete, complete overlap-group recovery, misses/merges/duplicates, partial recovery and review burden, stratified by difficulty. Record how much each realistic rendering ingredient changes performance instead of assuming realism helps.
6. **Measure transfer on real images.** A held-out synthetic result proves performance only on the renderer. Compare frozen models on separate public real-overlap annotations if an accessible, sufficiently complete source is found. Otherwise report that transfer is unmeasured and use unlabeled Academy fields only for qualitative failure inspection. Later incorporate provisional user corrections and targeted expert adjudication to assess real Academy overlaps and human parity. Do not tune against the final real test set.

## Decision gates and risks

- **Promising:** a synthetic-trained method improves distinct-overlap recovery against the existing baseline at a comparable false/duplicate or review burden on source-separated data, and the improvement survives real-image evaluation without major regressions on ordinary specimens.
- **Stop or change:** better synthetic scores disappear on real slides, masks merge nearby valves, or proposal counts and review cost become impractical. Test whether that is caused by the rendering gap, source leakage, incomplete labels, ranking or the model itself before adding complexity.
- **Main risk:** models may learn synthetic cutout edges, opacity or simplistic optics instead of diatom structure. The source/background split, varied renderer and untouched real evaluation address this risk but cannot eliminate it by themselves.
- **Resource constraint:** keep CPU work at two threads and use bounded experiments with checkpoints; scale only after a useful initial comparison. Maintain original source and trained-model provenance and safe model-loading procedures.

## Deliverables

A reproducible generator with recipe/label manifests and image examples; source-group audit and frozen split; a compact initial trained baseline and matched controls; an HTML report showing successes and failures across all conditions; and a separate real-image transfer report. This entry records a proposed next experiment, not a completed training result.

## Grayscale prototype update

Both source cutouts and slide backgrounds are converted to grayscale before compositing; all 24 output scenes are 8-bit grayscale. [See examples](/results/r112/) · [generator](/research/r112_grayscale.py) · [verification](/results/r112/design/prototype-grayscale/verify.log). All 66 instance masks and metadata match the original color prototype. Hard paste edges, unknown background organisms and contrast differences remain; grayscale alone does not validate these examples for training.

## Crowding and translucency update

Generated 32 development scenes with 4–18 translucent insertions per busy Academy background and independently stored overlapping support masks. Source opacity, scale and contrast vary; the background may contain real unannotated diatoms, and transparent visible-mask truth is undefined. The 336 placements reuse 16 specimens from two genus folders; species and biological independence are unknown. These are renderer checks, not a training or biological accuracy result. [See examples](/results/r112/) · [manifest](/results/r112/design/translucent/manifest.json) · [verification](/results/r112/design/translucent/verify.log). The user requested a network-accessible Academy scan review tool after reasonable model performance; see [R113](/research/R113.md).

## Morphology-source expansion

Added 16 previously inspected structural mask/box matches from 11 Gündüz images to the existing 16 Khanom cutouts. The expanded renderer uses 32 source objects from 27 images and eight source-labeled genera; raw source taxon names and masks are not independently confirmed. [Visual gallery](/results/r112/) · [scene manifest](/results/r112/design/diverse/manifest.json) · [checks](/results/r112/design/diverse/verify.log). It narrows, but does not solve, source diversity or establish independent samples, real performance or training readiness. Gündüz derivatives carry CC BY-NC-SA 4.0 terms.

## Broader source and species-detail preservation

After noncommercial use was approved, added 26 additional candidate components from 23 previously examined images, excluding one previously quarantined source. Latest preview uses 58 source objects from 50 images and 19 source-labeled genera; taxonomy and sample independence are unverified. Preserved all 58 unresized source crops and individual supports with hashes. The current scene renderer still normalizes cutouts and is not suitable for species-detail training; physical scales remain unknown. [Gallery](/results/r112/) · [source audit](/results/r112/design/source-audit/r80-audit.json) · [native assets](/results/r112/design/native-assets/manifest.json) · [native checks](/results/r112/design/native-assets/verify.log). Gündüz derivatives are CC BY-NC-SA 4.0.

## Native-grid scenes and Academy calibration

Created 24 development scenes with native-grid cutouts and source provenance; 67 of 120 insertions are clipped, and public source scales remain unknown. Academy scan filenames report 40× and nominal 0.5 µm Z steps, while the recorded OME XY calibration is about 0.114 µm/pixel and varies slightly by scan. [Native scenes and per-background calibration](/results/r112/design/native-scenes/background-calibration.json) · [verification](/results/r112/design/native-scenes/verify.log). Native-grid source placement is not a physically matched scale.

## UDE source calibration and provisional masks

Audited 64 previously used UDE development crops spanning four dataset-named species. The [source paper](https://academic.oup.com/gigascience/article/doi/10.1093/gigascience/giae087/7912108) reports 0.09 µm/pixel; resampled each to an identified Academy slide's OME XY calibration while retaining original pixels. The available source annotations are rough rectangles. Generated point- and box-prompt mask **proposals**, not labels: 47/64 box masks cover ≥80% of the crop (point: 1/64), and three crops are shorter than the recorded annotation box along an axis. [All candidate comparisons](/results/r112/design/ude-calibrated/) · [source and scale provenance](/results/r112/design/ude-calibrated/manifest.json) · [verification](/results/r112/design/ude-calibrated/verify.log). Do not train or claim real accuracy until source masks, taxonomy, independence and appropriate unknown-background handling are resolved.

## Additional locally available UDE candidates

Processed 61 previously viewed crops from one UDE source slide, with 11 source-labeled genera and 11 non-`None` source species strings, using published 0.09 µm/pixel and scan-specific OME target scales. The source shapes are rough rectangles/circles; model outputs remain uncertain proposals, not usable verified masks. Box masks cover ≥80% of the crop in 58/61 cases. Twenty-five mask inferences downsampled inputs to fit the model; original source pixels remain. [All cases](/results/r112/design/ude-prefix/) · [manifest](/results/r112/design/ude-prefix/manifest.json) · [verification](/results/r112/design/ude-prefix/verify.log). Same-slide correlations, taxonomy, source annotation quality and real performance remain unresolved. A local network attempt to access the full archive failed DNS resolution; availability elsewhere was not determined.

## Broader UDE development source acquisition

Fetched 120 additional public UDE cutouts chosen from metadata before viewing: 30 source-labeled species in 28 genera, four distinct slide-name groups per taxon and 93 slide-name groups total. [Visual gallery](/results/r112/diversity-fetch/) · [frozen selection](/results/r112/diversity-fetch/selection.json) · [download report](/results/r112/diversity-fetch/download-report.json) · [exact-byte duplicate audit](/results/r112/diversity-fetch/duplicate-audit.json) · [calibrated asset manifest](/results/r112/diversity-fetch/assets.json) · [verification](/results/r112/diversity-fetch/verify.log). All 120 archive members passed ZIP CRC, hashes and recorded physical-scale transform reconstruction; no exact hash duplicates against 175 previous UDE crops. Near-duplicate or biological-sample independence, taxonomy and mask quality remain unverified. They are development source crops, not a labeled segmentation training set, held-out test, or performance result. Source annotations include 99 rough rectangles, 18 circles and three polygons. UDE source terms are CC0; other sources/model terms remain separate.

## Species-depth source acquisition

Downloaded 300 further UDE crops selected before viewing from ten source-named species and 60 disjoint filename-derived slide groups: 200 development, 50 validation candidates and 50 test candidates. Sample independence is not established, and candidate test material is not used for training or previewed. A predeclared whole-crop similarity screen against 295 earlier UDE images and across partitions flagged two nonexact development examples; both remain quarantined. Prepared 198 source-preserving, Academy-scale development candidates, not verified masks or final species labels. [Development gallery](/results/r112/species-depth/) · [selection](/results/r112/species-depth/selection.json) · [similarity screen](/results/r112/species-depth/similarity-screen.json) · [verification](/results/r112/species-depth/verify.log). All 300 CRCs and hashes, split constraints, quarantine decisions and development scale transforms verified; screen replay was byte-identical. Scientific source/sample relationships remain to be established.

## Species-depth development mask hypotheses

Generated three rough-annotation-derived MobileSAM point-mask hypotheses for each of the 198 nonquarantined development crops, retaining all 594 masks and original pixels; 13 inputs were resized for inference. A predeclared image-geometry rule marks 154 as consistent-unverified and 44 for inspection. This is **not** a correctness or performance score; multiple prompts to the same model can agree on the wrong object. [All cases](/results/r112/species-depth/mask-hypotheses/) · [protocol](/results/r112/species-depth/mask-hypotheses/protocol.json) · [verification](/results/r112/species-depth/mask-hypotheses/verify.log). Validation/test candidate crops were not used. No masks are approved as training ground truth.

## Mask-consistency source proxy audit

Compared the fixed three-prompt consistency rule against 58 previously examined local source regions: 42 Gündüz box/component proxies and 16 Khanom polygons. The 48 consistent cases had center-mask source-region IoU ≥0.5 in 48/48 and ≥0.75 in 46/48. The ten needs-inspection cases had 8/10 and 6/10, respectively. Gündüz source masks are structural proxies and Khanom prompts use reference-derived boxes; samples are previously viewed and biologically independent overlap evidence is absent. These are not UDE accuracy or verified training-label rates. [All cases](/results/r112/design/mask-gate-audit/) · [verification](/results/r112/design/mask-gate-audit/verify.log). The UDE masks remain unverified.

## Weak-label calibrated development-scene draft

Generated 240 grayscale scenes with 1,200 weak-label placements balanced over ten source taxa, reusing 154 unverified model-mask sources and eight Academy backgrounds. Instance supports remain separate and may overlap; original background and transparent visibility remain unknown. Source scale was mapped to scan-specific OME XY calibration; this is an additive image proxy, not physically validated optics or a production training set. [All scenes](/results/r112/weak-development-v1/) · [protocol](/results/r112/weak-development-v1/protocol.json) · [recipes](/results/r112/weak-development-v1/manifest.json) · [reconstruction](/results/r112/weak-development-v1/verify.log). A posthoc signal diagnostic found 310/1,200 insertions averaged below five 8-bit gray levels of immediate change within their supports; this is not a visibility or accuracy metric. Preserve source and model-mask uncertainty and validate before training.

## Paired synthetic contrast diagnostic

Replayed 32 previously viewed weak-label scenes with identical 160 placements at additive residual gains 1×, 2× and 4×. Median per-placement mean pixel change increased from 7.47 to 14.80 to 28.40 (8-bit levels), while newly boundary-valued support-pixel counts increased from 2,147 to 14,585 to 65,612. Repeated pixels across overlapping supports can be counted multiple times. These are renderer diagnostics, not biological accuracy or physical realism; no gain has been approved for training. [All paired scenes](/results/r112/design/contrast-study/) · [protocol](/results/r112/design/contrast-study/protocol.json) · [verification](/results/r112/design/contrast-study/verify.log).

## Species-signal preservation diagnostic

On 59 previously examined development source cutouts in the four-class R36 classifier vocabulary, froze the first synthetic placement per source and compared exact source-name matches: original 38/59, physically resampled/rotated source control 31/59, and known-placement synthetic crop 23/59. The classifier is forced to choose one of four source-named taxa and uses oracle crop locations; labels, sample independence, model competence and optics are unverified. An initial transformed control accidentally included black rotation-fill corners and reported 26/59; it was corrected after visual inspection and retained as superseded history. [Corrected comparisons](/results/r112/design/species-retention-corrected/) · [protocol](/results/r112/design/species-retention-corrected/protocol.json) · [verification](/results/r112/design/species-retention-corrected/verify.log). This is a reason not to promote the current renderer, not a measurement of Academy species accuracy.

## Species-signal versus insertion gain

On the same 59 previously inspected species-retention development cases, used the unchanged four-class classifier on original crops and known-position synthetic crops at residual gains 1×/2×/4×. Source-name matches were 38/59 original and 23/24/23 of 59 synthetic. Newly boundary-valued target-support pixel counts were 857/7,244/32,710 of 454,992 counted support pixels; overlapping/neighbor effects can repeat pixels. These are exploratory model and numerical saturation diagnostics, not species accuracy, real optical validation or evidence that any gain is training-ready. [All comparisons](/results/r112/design/species-gain-study/) · [protocol](/results/r112/design/species-gain-study/protocol.json) · [verification](/results/r112/design/species-gain-study/verify.log).

## Direct and locally matched alpha blending

On the same 59 previously viewed development cases, compared additive v1 against direct alpha and local-ring-median-matched alpha while holding positions, source supports and opacity fixed. Frozen four-class source-name matches were **23/59, 21/59 and 22/59** respectively (original crops 38/59). Newly final-boundary-valued target-support pixels were **857, 2 and 0** of 454,992 counted pixels; the alpha implementations clip source target values before blending and the metric can count overlap repeatedly, so fewer final endpoints do not prove better imagery. These are exploratory development diagnostics, not Academy species accuracy or optical validation. [All comparisons](/results/r112/design/species-blend-study/) · [protocol](/results/r112/design/species-blend-study/protocol.json) · [verification](/results/r112/design/species-blend-study/verify.log).


## Source-site audit and expanded development pool

The published UDE supplemental metadata is now joined to source slide names, and the full archive is checksum-verified. Conservative site-code/coordinate grouping reveals overlap between the prior local filename-separated synthetic partitions. This does not prove same-sample reuse, but removes any basis for location-independence claims. The [audit](/results/r112/ude-sampling-metadata/) documents the exact scope, one unresolved source slide and a guarded exposure ledger. The only three location components without a known prior selection have 906 image records but only two species-named images, so they cannot support broad independent species evaluation.

Selected and verified [4,000 development source crops](/results/r112/species-scaleup/) across 80 source-name strings with location and slide caps; 26 were on the already-consumed earlier comparison side. The UDE authors describe expert taxonomic identification and quality review, but those concepts remain unreconciled with Academy taxonomy and the rough source annotations are not validated pixel masks. [Three-prompt mask proposal generation](/results/r112/species-scaleup/mask-hypotheses/) is ongoing; outputs are unverified and must not automatically be treated as ground truth.

Next research tasks: (1) audit which newly generated masks select the intended organism, especially crowded and clipped crops, using independent reference masks where available; (2) identify a genuinely independent, species-labeled, freshwater source covering more than the two species represented by the three candidate-unseen UDE locations, and document biological sample grouping and permissions; (3) test synthetic-data training against real-only and alternative weak-label controls on a newly frozen site/sample-separated evaluation, without treating unknown background as negative; (4) reconcile taxon concepts and obtain scientist review at the appropriate stage before species-level claims; (5) keep R113 gated until actual model performance supports meaningful Academy validation.
