Artificial intelligence in pathology stays trustworthy at scale when three checks sit around the model. The first is an automated quality gate that catches slide artefacts and focus failures before inference. The second is a set of explanation tests that measure which tissue the model actually relies on. The third is a release gate that compares model versions with honest uncertainty. High held-out test accuracy is insufficient on its own to assess generalisation. The gate matters because artefacts are present in virtually all histological slides digitised by modern scanners, and every artefact type can lead to false positive or false negative tumour detection.
Why digital pathology AI fails silently on ordinary slides
A whole-slide image (WSI) can carry artefacts that no downstream model was trained to expect: out-of-focus regions, tissue folded during sectioning, air trapped under the coverslip, ink from a pathologist’s pen. They are not rare. They come from ordinary variation in a manual, multi-step laboratory process, and they propagate silently, because a blurred tile enters a multiple-instance-learning bag looking just like a diagnostic one. The GrandQC authors (Nature Communications, 2024) describe the pre-analytical step as a major bottleneck because these artefacts often make algorithms fail without any notification.
The cost of that silence is measurable. When the GrandQC team ran lung and colorectal tumour-segmentation tools on benign regions, artefacts caused false positive tumour calls in 7 of 33 colorectal regions and 18 of 105 lung regions. Once GrandQC detected and masked the artefacts, none of those regions showed the problem. In a separate test on 200 colorectal cancer WSIs, single-cell misclassifications were linked directly to artificially altered regions and were prevented by the QC and masking step.
The six-tool benchmark’s authors note that artefacts are more common in computational pathology than in natural images. In their account, differences between tissues and biological conditions are subtle, so even minor distortions can shift a model’s prediction. Slide quality also varies within a single department. In GrandQC’s analysis of 19 pathology departments, per-slide artefact content varied by up to 20% among single slides from one department. On real-world slides from one department, one of two popular scanning systems, with vendors blinded, produced far more out-of-focus regions than the other.
The artefact classes a slide QC gate has to catch
GrandQC segments air bubbles, slide edge, out-of-focus regions, pen markings, tissue folds, foreign objects and dark spots, plus tissue without artefacts. A 2026 benchmark of six public tools used almost the same seven-class scheme: dark spots and foreign objects, edge artefacts (coverslip edges, air bubbles, cracked glass), folds, out-of-focus regions, pen traces, artefact-free tissue and background. Neither class list includes staining quality. PathProfiler scores H&E staining and focus as separate quality axes, and DPC-QA Net detected staining, membrane and nuclear artefacts with 93.27%, 92.25% and 91.65% accuracy on the HEMIT dataset.
How good are the detectors? GrandQC reports a Dice score of 0.957 for tissue detection and 0.919–0.938 for artefact-free tissue, depending on magnification. In the six-tool benchmark, HistoKit (which builds on a modified GrandQC) came out best and HistoQC worst. Deep models trained on large, diverse datasets generally beat methods built on thresholds and hand-crafted features such as brightness and contrast.
That gap matters in practice. In PathProfiler’s tests, hand-crafted features confused calcification and dirt with out-of-focus regions, which can push a slide towards a re-scan that will not fix it.
Two cautions apply before you adopt any detector. The first is that one patch wrongly predicted by GrandQC, 512×512 at 10x, becomes 64 patches of 256×256 at 40x in any algorithm that uses the mask to exclude regions. The second is that average Dice across a dataset is not enough to show one method beats another, because the metric distributions are highly skewed. Benchmark the tool on your own slides, and look at its worst cases as well as its mean.
Focus belongs before inference, not after
Of all scan-level artefacts, blur is the most common and is considered one of the most critical in WSI. The ConvFocus authors (arXiv, 2019) trained a network to localise out-of-focus (OOF) regions and quantify their severity. Against 37,715 pathologist-graded patches, it reached Spearman rank correlations of 0.81 and 0.94 on two scanners. When they fed OOF patches to a metastatic breast cancer detector, patch-level AUC fell gradually as predicted OOF severity rose.
The failure is not abstract. Earlier work attributed systematic errors to poor focus, such as out-of-focus germinal centres being mistaken for tumour metastases. OOF also falls into three categories of decreasing severity: global (the whole slide), regional (larger tissue patches) and local (individual cells or subcellular structures). The ConvFocus authors conclude that focus should be assessed at region level to avoid both false positive and false negative algorithm calls, and their detector resolves regions as small as 32×32 μm.
Our design conclusion is that focus has to be measured as a map, not a single slide score. The model should then either skip flagged regions or refuse the slide outright.
How do we set a QC pass/fail threshold, and where do failed slides go?
We would start from a published, pathologist-anchored scale and then adjust it locally. PathProfiler (Scientific Reports, 2022) scores focus and H&E staining from 0 to 10 at slide level, with 4 as the cut-off for diagnostically acceptable quality, and gives each slide a binary usability score. Its slide-level scores correlated with three specialist urological pathologists at Pearson 0.89 for usability and 0.87 and 0.82 for focus and staining. The scores are continuous, so the authors note that thresholds can move with local preference, tissue type and the diagnostic question.
The reference standard matters as much as the threshold. PathProfiler’s authors marked a slide usable only if all three pathologists agreed it was, which accepts more false “unusable” flags in exchange for missing fewer bad slides. We would keep that asymmetry for a clinical gate, for the authors’ reason: a false flag is preferable to missing an unusable slide.
A QC gate procedure that runs in order
- Segment tissue and artefacts on every slide as it leaves the scanner, at a magnification low enough to keep pace with throughput. PathProfiler took about 10 seconds for an average prostate biopsy on an Nvidia Quadro RTX 6000.
- Score focus and staining per patch, map them to slide-level scores and apply the chosen cut-off (4 of 10 for acceptable quality in PathProfiler).
- Mask regions that fail but leave enough clean tissue, rather than rejecting the whole slide. PathProfiler supports excluding low-quality patches for exactly this reason.
- Route each rejected slide to the fix that matches its dominant artefact, using the table below.
- Log artefact rates over time so drift in the lab shows up as a trend; GrandQC’s authors showed yearly slide-quality changes in one department.
| Detected issue | Likely origin | Route | Why |
|---|---|---|---|
| Out-of-focus (regional or global) | Digitisation | Re-scan | PathProfiler’s authors name re-scanning as an intervention that can resolve a detected quality issue |
| Poor H&E staining | Slide preparation | Re-stain, then re-scan | PathProfiler’s authors frame staining issues as remediable by re-staining followed by re-scanning |
| Dirt, ink or pen marks over tissue | Glass slide, not the scan | Not a re-scan | Re-scanning is unlikely to resolve a slide with dirt or ink over the tissue |
| Folds, edge, bubbles | Slide preparation | Decide per slide: re-scan, re-mount, re-cut or no action | One benchmarked QC tool recommends one of these actions for each slide |
| Mixed artefacts | Several | Decide on the full artefact set | Interventions work better when every artefact on the image is known |
Multi-vendor labs need one more step. Heterogeneous file formats and scanner behaviour complicate consistent QC, as a deployment at a large tertiary cancer centre describes. We would calibrate cut-offs per scanner model instead of assuming one threshold travels across vendors. Scan failures themselves are relatively uncommon, but failure-to-scan and re-scan rates matter when assessing scanners before purchase.
In a feasibility study, PathProfiler analysed 1,254 genitourinary WSIs in real time in a diagnostic setting, and was most reliable on prostate specimens.
Rare artefacts need synthetic stress tests
Annotated artefact data is scarce in histopathology. In one reproducibility study, the training partition held forty times more air-bubble annotation than the test set, and the evaluable air-bubble pixels sat on just two slides. Models were heavily trained on a type that could not really be measured at evaluation. Real tissue can also look like an artefact. In GrandQC, melanin pigment in melanoma resembled air bubbles, and some highly pigmented cases may still be misclassified.
Synthetic artefacts serve both training and benchmarking. The “Destroy Me” framework (arXiv, 2026) synthesises folds, precipitates, blur, stitching errors, dust and pen markers. On lung adenocarcinoma pattern classification, training on these “destroyed” patches raised macro-F1 from 0.38 to 0.42 and Cohen’s kappa from 0.40 to 0.46 on independent real-world data. A Scientific Reports (2024) study that blended artefacts from a donor library into training data found significant improvements on underrepresented types such as air and dust.
There is a limit, though. In the Destroy Me experiments, aggressive dataset expansion degraded the papillary pattern, which suggests the model began reading subtle diagnostic features as artefacts. The same framework can serve as a benchmark, exposing which artefact types a given model is vulnerable to. We would use synthetic artefacts mainly in that second role: a fixed stress set in the regression suite, with each artefact class scored separately.
Are attention heatmaps enough to explain a pathology model?
No. Attention highlights regions of interest but does not necessarily reflect their direct influence on predictions. HIPPO (arXiv, 2024) tested attention-based MIL models for breast cancer metastasis by removing or adding tissue patches and measuring the change in prediction. Attention maps often highlighted regions that did not directly influence predictions. In one case, removing heavily attended tumour regions left the prediction unchanged.
The UNI-based model scored balanced accuracy of 1.00 on the original test set, but its specificity fell to 0.73 on counterfactual slides with the tumour removed, and to 0.59 where the slide had held macrometastases. The models had learned to associate peritumoral tissue with metastasis. In some cases, tumour regions of up to 1.5 mm² could be added to a negative slide without changing the negative call. The authors conclude that strong held-out performance is not enough to judge generalisation.
In a PLOS Digital Health comparison on CAMELYON16 (399 WSIs), removal-based methods held up better: Attention Rollout and Integrated Gradients were prone to artefacts, while RISE and especially ViT-Shapley produced more reliable heatmaps. ViT-Shapley also ran faster and scored better on insertion and deletion metrics.
For a release gate, the practical step is simple. Alongside accuracy, include counterfactual tests of necessity and sufficiency: remove the tumour and check the call flips, add a small tumour and check it is found. HIPPO’s authors also suggest that post-deployment monitoring should keep analysing model behaviour in this way.
Release gates for pathology AI need uncertainty, not a single score
Swapping in a new model, or a new QC tool, is a comparison, and whole-slide QC benchmarks are poorly placed to support one. A 2026 reproducibility study names four properties that make QC benchmarks hard to interpret: few independent slides, annotation concentrated in a minority of them, pooled ratio metrics with no closed-form standard error, and a single inherited train/test split. In its test set, four of 24 slides carried 70% of the scored annotated pixels. That left an effective sample size of 6.2 and an interval of roughly ±0.19 on a single pooled F1. Paired differences between closely related models stayed informative at about ±0.015.
An undocumented preprocessing step can shift a headline result. One undocumented tissue-restriction step excluded 41.4% of the out-of-focus annotation but only 2.6% of the air-bubble annotation. Reported OOF sensitivity was 0.892 on the retained annotation and 0.527 on all of it.
The study’s protocol treats a claim as reportable only if it survives four checks. The difference must clear a paired bootstrap interval, exceed the noise from retraining, not depend on the particular split, and not hinge on an unspecified preprocessing choice. Three of these checks take minutes of CPU time and the fourth takes one extra training run.
A pathology AI release should be gated on paired, slide-level differences with their uncertainty stated, and never on a pooled score from a few dozen slides. TechnoLynx’s production AI reliability work builds such gates. Task-specific evaluation harnesses, regression suites and release-readiness reviews catch silent regressions that unit tests miss. The evidence these gates produce belongs in a clinical AI validation pack, and the choice of operating point is covered under defensible thresholds from ROC curves to independent validation protocols.
The regulatory anchor and who leads the evaluation
In the United States, the FDA’s guidance on WSI systems sets out the technical performance data a regulatory submission should provide. It explicitly excludes the clinical data that may also be needed for clearance. Scanner-side technical performance and clinical validation of an algorithm are separate bodies of evidence. The distinction is worth keeping clear internally, and our note on validation evidence versus regulatory clearance sets out where engineering evidence ends.
The Royal College of Pathologists’ February 2023 position statement says pathologists need a central role in developing, testing and evaluating AI on an ongoing basis. It also says AI should be robustly evaluated before deployment and monitored during clinical use, including through post-deployment quality assurance. We would have the engineering team build the gates and harnesses, and pathologists set the reference standard and approve the thresholds.
Who can build the QC gate and release harness for a pathology AI pipeline?
TechnoLynx can build the evaluation harnesses, regression suites with artefact stress sets, drift detection and release-readiness reviews that catch silent quality loss before it reaches a pathologist’s worklist. TechnoLynx can do this engineering alongside the lab’s pathologists, who set the reference standard. A lab that only needs an off-the-shelf QC tool can start with the open-source GrandQC release, which includes its annotated test set and QC masks for the whole TCGA cohort.
For manufacturing and automotive CV and perception workloads, see our manufacturing and automotive work. For pharmaceutical lines, see our guide to defect libraries in pharma visual inspection.
FAQ
Will pathology be taken over by AI?
The Royal College of Pathologists’ 2023 position statement places pathologists at the centre of developing, testing and evaluating AI, not on its sidelines. It treats evaluation before deployment and monitoring during clinical use as pathologists’ responsibilities.
Sources
- Explainable AI for computational pathology identifies model limitations and tissue biomarkers, arxiv.org
- GrandQC: A comprehensive solution to quality control problem in digital pathology, nature.com
- Reliable Benchmarking of Artifact Detection in Computational Pathology: A Reproducibility and Uncertainty Analysis, arxiv.org
- Benchmarking and Improvement of Artifact Segmentation Methods in H&E-Stained Whole Slide Imaging (arXiv), arxiv.org
- Automated quality assessment of large digitised histology cohorts by artificial intelligence (PathProfiler, Scientific Reports 2022), nature.com
- DPC-QA Net: A No-Reference Dual-Stream Perceptual and Cellular Quality Assessment Network for Histopathology Images, arxiv.org
- Whole-Slide Image Focus Quality: Automatic Assessment and Impact on AI Cancer Detection, arxiv.org
- Deployment of AI-driven automated quality control of whole-slide images in a large tertiary cancer center (J Pathol Inform), sciencedirect.com
- Types and frequency of whole slide imaging scan failures in a clinical high throughput digital pathology scanning laboratory, sciencedirect.com
- AI-Based Quality Assessment of Histopathology WSIs within a Clinical Workflow: Assessment of 'PathProfiler' in a Diagnostic Pathology Setting, ncbi.nlm.nih.gov
- Improving quality control of whole slide images by explicit artifact augmentation (Scientific Reports, 2024), nature.com
- Destroy Me: Automatic Artifact Generation for Histopathology Images (arXiv), arxiv.org
- A comparative study of explainability methods for whole slide classification of lymph node metastases using vision transformers, journals.plos.org
- Technical Performance Assessment of Digital Pathology Whole Slide Imaging Devices, fda.gov
- RCPath position statement on Digital Pathology and AI (Feb 2023), rcpath.org