# Patchgastricadc22 Eval

> This evaluation probes a model's ability to generate clinically accurate diagnostic captions from histopathological image patches. It specifically tests the model's capacity to capture subtype-specific terminology and overall caption fluency using standard and custom n-gram overlap metrics. Use when the user wants to benchmark on PatchGastricADC22, or asks about evaluating this task. Reports BLEU@4.

- Skill: `qhjqhj00/patchgastricadc22-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/patchgastricadc22-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/patchgastricadc22-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/patchgastricadc22-eval

---


# patchgastricadc22-eval

> Inference of captions from histopathological patches — Masayuki Tsuneki, Fahdi Kanavati (2022) (arXiv:2202.03432, 2022)

## What this evaluates

This evaluation probes a model's ability to generate clinically accurate diagnostic captions from histopathological image patches. It specifically tests the model's capacity to capture subtype-specific terminology and overall caption fluency using standard and custom n-gram overlap metrics.

## Datasets

- **PatchGastricADC22** — total 262777; splits: test (198); repo https://github.com/masatsuneki/histopathology-image-caption

## Metrics

- `BLEU@4` **(primary)** — range: [0, 1]
  - Standard BLEU-4 score computing the geometric mean of precision for 1-gram to 4-gram matches between predicted and ground truth captions, adjusted by a brevity penalty to penalize overly short outputs.
- `Avg 1/2-gram` — range: [0, 1]
  - Average of the 1-gram and 2-gram overlap scores specifically measuring the occurrence of subtype class words in the predicted captions compared to ground truth, to verify if shorter subtype terms appear in the output.

## Input / output format

**Input**: Histopathological image patches extracted at x10 or x20 magnification from gastric adenocarcinoma whole slide images.

**Output**: Diagnostic caption text describing the histopathological features and adenocarcinoma subtype.

## Scoring recipe

```python
def compute_bleu4(reference, hypothesis):
    return nltk.translate.bleu_score.sentence_bleu([reference], hypothesis, weights=(0.25, 0.25, 0.25, 0.25))

def compute_avg_1_2gram(reference, hypothesis):
    subtype_words = extract_subtype_class_words(reference)
    pred_tokens = tokenize(hypothesis)
    ref_set = set(subtype_words)
    pred_set = set(pred_tokens)
    overlap_1 = len(ref_set & pred_set) / max(len(ref_set), 1)
    overlap_2 = nltk.translate.bleu_score.sentence_bleu([reference], hypothesis, weights=(0.5, 0.5), max_n=2)
    return (overlap_1 + overlap_2) / 2
```

## Common pitfalls

- BLEU@4 relies on exact n-gram matching and may penalize clinically valid paraphrases or synonyms.
- The custom 1/2-gram metric only evaluates subtype class words, ignoring other diagnostic terms and clinical context.
- High standard deviations across runs indicate significant variance; results should be averaged over multiple seeds rather than reported from a single run.

## Evidence (verbatim from paper)

> We computed the BLEU@4 score between the ground truth captions and the predicted captions. We also computed a score measuring the average score of 1-gram and 2-gram (avg. 1/2-gram) word overlaps of the occurrence of the subtype class in the predicted captions; this is to measure if at least any of the shorter words that occur in the subtype name occured in the predicted caption.

## Citation

```bibtex
@misc{tsuneki2022inference,
  title={Inference of captions from histopathological patches},
  author={Masayuki Tsuneki, Fahdi Kanavati (2022)},
  year={2022},
  note={arXiv:2202.03432}
}
```

- arXiv: 2202.03432

