Grail Computer · research record
Archived candidate review, with publication notes. This is the earlier ten-image review, before the requested normal-image improvement. “Final” and “submission” below refer to that selection snapshot, not completed qualification or upload. Historical HP/mixed labels are intended labels, not verified infection. The statement that no patient arrangement is reproduced does not apply across routes. See current qualifications.

Synthetic gastric H&E fields for the SGH challenge

Grail Computer · preselection set · 9 September 2026 · ten 4096×2048 RGB PNG images at 0.25 µm/px (3 H. pylori gastritis, 2 intestinal metaplasia, 2 mixed, 3 normal)

What this document is. The ten images we propose to submit, the real fields they were measured against, the best images from every method we tried, and the method that produced the ten. Every number is an engineering measurement; no pathologist has reviewed any image, the H. pylori organisms are drawn procedurally, and the category names are the labels of the public dataset fields each image was generated for. Those three caveats are repeated where they matter.

1. The original reference

All real tissue in this work is from HiESD, a public dataset of 17 whole gastric slides (CC BY 4.0). Three slides were held out from every tuning and training step; the fields below are from held‑out slide 0d55cc29 and are the reference the ten were compared against. Left: the full 4096×2048 field (1024 × 512 µm). Right: a 768‑pixel window at native resolution (192 µm across), where one cell nucleus is about 30 pixels wide.

Real H. pylori gastritis field

Real · H. pylori gastritis · full field

Real H. pylori gastritis crop

Real · gastritis · 768 px at 1:1

Real intestinal metaplasia field

Real · intestinal metaplasia · full field

Real intestinal metaplasia crop

Real · intestinal metaplasia · 1:1

Real mixed field

Real · mixed · full field

Real mixed crop

Real · mixed · 1:1

Real normal field

Real · normal · full field

Real normal crop

Real · normal · 1:1

What the real fields measure as. The two numbers used throughout are: holes — the share of closed gland rings that enclose a pale lumen (real held‑out medians 0.81 gastritis, 0.77 metaplasia, 0.77 mixed, 0.88 normal); and D — a distance from real tissue on 54 classical measurements of nuclei, stroma, stain and texture, calibrated on 24 real training fields per category (real held‑out fields themselves sit at a median D of 4.2 gastritis, 2.6 metaplasia, 3.7 mixed, 3.3 normal, with a maximum of 8.0 / 4.5 / 4.4 / 4.3). An image is "inside the real band" when its D is at or below that maximum.

2. Best images across all runs, per category

Four families of method produced candidates. They differ in where the tissue layout comes from, which matters for a later stage where inputs would be patient slides:

Family Layout comes from Appearance comes from Provenance note
single‑donor repaint one real public field the same field re‑draws that field's arrangement with new cells
mosaic (A5) ~10–12 real fields, one per window, chosen to match a synthetic drawing those fields no single slide's arrangement; still real arrangements
bag of patches (A5) none in particular random patches of many fields cleanest provenance; layout is the model's own
procedural layout (F3) our 3‑D tissue drawing, through a trained adapter one real field's tokens the only family whose arrangement is synthetic by construction

The sheets below show, per category, the lowest‑D image of each family (512 px at 1:1) beside the real reference. A label says whether that image also passed the selection filters in section 3.

Best per family, gastritis

H. pylori gastritis · best of each family beside real. The procedural‑layout cell has the best D in the category (3.49) but is a faded field with more than twice the real pale fraction — the reason the selection carries a pale‑tissue rule.

Best per family, intestinal metaplasia

Intestinal metaplasia · the mosaic image at D 2.60 is inside the real band and became final 04.

Best per family, mixed

Mixed · the mosaic image at D 2.95 became final 06.

Best per family, normal

Normal · the weakest category: three of the four family bests fail the hole‑score range; the single‑donor image at D 3.66 became final 08.

Category Procedural layout Bag of patches Mosaic Single donor
Gastritis D 3.49 (fails pale rule) D 5.02 D 4.72 D 5.01
Metaplasia D 3.52 D 2.74 D 2.60 → final 04 D 3.17
Mixed D 4.33 D 3.01 D 2.95 → final 06 D 4.46
Normal D 3.27 (→ final 10, see §3) D 3.38 D 3.10 D 3.66 → final 08

3. The ten proposed submissions

Selection rule. From every heavy‑repaint or adapter output of the programme with per‑image measurements (244 canvases), keep an image only if (1) its D is inside its category's real band — for gastritis additionally its pale‑tissue fraction is within 1.5× real, to exclude faded fields that score well on holes; (2) its hole score is inside the real held‑out range; (3) its copy‑screen margin is at least 0.05 below the fail line and no pixel window matches a real field; (4) no two finals share a drawing seed within a category; (5) no two finals of a category are more than 0.75 similar. Survivors were ranked by D, ties broken toward synthetic layout provenance, then checked by eye at 1:1 against the real reference. Two relaxations were made and are stated under the table.

# Category (as labelled) Family D (real max) Holes (real range) Copy margin Organisms
01 H. pylori gastritis procedural layout 3.85 (8.0) 0.90 (0.30–1.00) 0.053 90
02 H. pylori gastritis procedural layout 4.55 (8.0) 0.64 0.050 90
03 H. pylori gastritis mosaic 4.99 (8.0) 0.46 0.146 78
04 Intestinal metaplasia mosaic 2.60 (4.5) 0.48 (0.13–0.95) 0.122
05 Intestinal metaplasia mosaic 2.64 (4.5) 0.43 0.137
06 Mixed mosaic 2.95 (4.4) 0.32 (0.27–1.00) 0.102 42
07 Mixed mosaic 3.50 (4.4) 0.38 0.110 36
08 Normal single donor 3.66 (4.3) 0.82 (0.67–0.98) 0.078
09 Normal procedural layout 4.24 (4.3) 0.69 0.085
10 Normal procedural layout 3.27 (4.3) 0.985 (0.009 above the real max; see below) 0.088

Relaxations, stated. Image 07 was first chosen by the rule as a bag‑of‑patches image at D 3.01 that turned out to have no surface or lumen large enough to carry the organism overlay; it was replaced by the next mosaic survivor of the same seed at D 3.50, which does. Image 10 was first admitted at D 7.12, outside the normal band; it was replaced by an image at D 3.27 that had been excluded only because its hole score (0.985) exceeds the maximum of the four real held‑out normal fields (0.976) by 0.009.

Screens on the ten final files. Pathology‑encoder similarity to any of 118 real fields: maximum 0.90 against a fail line of 0.95, zero flagged tiles. Pixel search: maximum window correlation 0.79 against a flag at 0.92, zero flagged windows. Neither screen tests inherited arrangement, which is disclosed per image below.

The images

Each pair: the full field at 1024 px, and a 768‑pixel window at native resolution at the same canvas position as the real reference crops in section 1.

01 full

01 · H. pylori gastritis · procedural layout · D 3.85 · 90 organisms

01 crop

Epithelial groups with one row of dark nuclei at their edge, small pit lumina, and a dense scatter of small nuclei between them — the only final whose inflammatory density exceeds real.

02 full

02 · H. pylori gastritis · procedural layout · D 4.55 · 90 organisms

02 crop

Long parallel gland profiles with foamy cytoplasm and a border row of nuclei; the vacuolation is coarser than real mucin, and the infiltrate is thin.

03 full

03 · H. pylori gastritis · mosaic · D 4.99 · 78 organisms

03 crop

Crowded pale cells with one nuclear row per group, a red‑cell cluster, small clear lumina; infiltrate thin.

04 full

04 · Intestinal metaplasia · mosaic · D 2.60

04 crop

Gland profiles with an open lumen and large basal nuclei; the vacuolation is diffuse rather than the crisp single goblet vacuole of unambiguous metaplasia.

05 full

05 · Intestinal metaplasia · mosaic · D 2.64

05 crop

Gland cross‑sections with clear lumina and a one‑cell wall with basal nuclei; same goblet‑cell caveat as 04.

06 full

06 · Mixed · mosaic · D 2.95 · 42 organisms

06 crop

Glandular clusters with one nuclear row each and a dense scatter of small dark nuclei between them: a glandular and an inflammatory component in one field.

07 full

07 · Mixed · mosaic · D 3.50 · 36 organisms

07 crop

Epithelial groups with pale vacuolated cytoplasm and dark ovoid nuclei, thin strands with spindle nuclei, small capillaries with red cells, and a scatter of small dark nuclei between the groups; gland profiles with open lumina elsewhere in the field. Its 36 organisms sit in the one channel large enough to take them, at the top centre.

08 full

08 · Normal · single donor · D 3.66

08 crop

The only final with a mucosal surface: empty slide above a surface strand, a columnar band below, gland profiles with clean lumina, a basal nuclear row and capillaries with red cells.

09 full

09 · Normal · procedural layout · D 4.24

09 crop

Polygonal cells with granular cytoplasm and one small round nucleus each, plausible as body‑type mucosa cut across — but one texture over the whole field, with no gland outlines or stromal bands.

10 full

10 · Normal · procedural layout · D 3.27

10 crop

Cohesive polygonal cells with granular cytoplasm and one round nucleus each, thin strands with spindle nuclei, capillaries with red cells; the crispest nuclear membranes of the ten. Its many small clear openings are intercellular gaps rather than gland lumina with a bordering row — which is what pushes its hole score just past the real maximum.

4. Methodology

The method has five stages. Each was measured before the next was built, and several earlier candidates for each stage were rejected on those measurements.

1. Real reference fields. From the 17 HiESD slides, 24 fields per category at 0.25 µm/px were extracted from 13 training slides, plus 22 fields from 3 held‑out slides used only for measurement. No SGH data was used.

2. Two instruments. A realism envelope: 54 classical measurements per field (nuclear count, size, shape and spacing along the gland wall; stroma fibre orientation; stain colour; texture), fitted on the training fields per category so that a generated image gets a distance D from real tissue, calibrated on the held‑out fields. A hole score: the share of closed gland rings enclosing a pale lumen. The envelope was needed because the hole score alone rewards faded images (fading a real field 40% toward white raises its hole score from 0.80 to 0.97).

3. A synthetic layout. A program builds a small 3‑D model of stomach lining — hollow gland tubes of the right diameters, pits, a dense inflammatory sheet and lymphoid follicles for gastritis, goblet vacuoles for metaplasia, a fibrous band at the base — slices it at a chosen angle, and emits a crude cartoon plus an exact label map of every pixel. Five presets (normal body and antrum, gastritis, metaplasia, mixed) were tuned until the cartoons' measurements sat inside the real range.

4. A pathology image model, driven three ways. The generator is PixCell‑1024, a diffusion model trained on pathology images, which paints a 1024‑px window from 16 appearance tokens produced by the UNI2‑h encoder; a 4096×2048 field is 21 overlapping windows on one shared canvas. A finding made during this work shapes everything: at any repaint deep enough to render convincing cells, the appearance tokens decide the layout of the output, and the start image barely matters. So three ways of choosing tokens were used for the final ten:

5. Organisms, screens and selection. The programme had not verified a suitable organism-positive training set; its bounded HiESD search found no likely organisms, so for the five H. pylori‑category images clustered faint curved rods, 2–4 µm long, are drawn procedurally inside surface mucus and pit or gland lumina, each recorded in a sidecar file. Every final passed a pathology‑encoder copy screen against all 118 real fields and a pixel‑level window search. The ten were then chosen by the rule in section 3 and checked by eye.

Rejected along the way, on measurement: hand‑painted layouts over real photos (the model kept the photo's arrangement when the painting was rotated); locking the lumens during generation (no effect at useful strengths, punched‑out holes at strong ones); a lighter or a third repaint (worse on every axis); more photorealistic cartoons (no effect on output); shuffled or averaged tokens (no layout gain; averages give structureless cell suspensions); conditioning on real surface windows (mucus over the whole field); and the first, nucleus‑aware adapter (right arrangement, twice too many undersized nuclei).

Compute. Eighteen work packages, 1,132 generated fields, 25.7 hours on rented A100 GPUs, about USD 56.

5. Disclosures and open items