Artifact detection is a pre-analytical deep learning step that automatically identifies and segments image regions containing tissue folds, air bubbles, pen marks, or out-of-focus areas within whole slide images. By flagging these distortions, the system prevents corrupted data from entering the diagnostic pipeline, ensuring that downstream classification models only process valid tissue.
Glossary
Artifact Detection

What is Artifact Detection?
Artifact detection is an automated computational quality control process that identifies and localizes non-biological irregularities in digital pathology images before diagnostic analysis.
Modern artifact detection leverages convolutional neural networks trained on annotated artifact masks to perform pixel-level segmentation of irregularities. This automated gatekeeping step is critical for computational pathology workflows, as artifacts can mimic morphological features and cause false-positive diagnoses if not excluded prior to slide-level classification or biomarker quantification.
Key Characteristics of Artifact Detection Systems
Artifact detection serves as a critical pre-analytical gatekeeper in computational pathology, preventing non-biological image regions from corrupting downstream diagnostic models.
Automated Quality Gate
Artifact detection acts as a pre-analytical filter that automatically identifies and excludes image regions containing non-diagnostic material before any tissue analysis occurs.
- Operates as a binary classifier on extracted patches: artifact vs. viable tissue
- Prevents garbage-in, garbage-out failures in slide-level classification
- Typically runs as the first step in a pathology pipeline, before tissue segmentation or feature extraction
- Reduces manual quality control review time by 90%+ in high-throughput labs
Common Artifact Categories
Detection systems must generalize across a taxonomy of common preparation and scanning defects that appear in whole slide images.
- Tissue folds: Overlapping tissue sections creating dense, hyperchromatic regions
- Air bubbles: Circular voids introduced during coverslipping, appearing as bright empty spaces
- Pen marks: Deliberate annotations from pathologists that can confuse diagnostic models
- Blur and out-of-focus regions: Scanner autofocus failures producing non-diagnostic patches
- Dust and debris: Particulate matter on the slide or scanner optics
Training Data Strategy
Building robust artifact detectors requires carefully curated datasets that represent the full diversity of real-world slide preparation artifacts.
- Requires pixel-level annotations or patch-level labels from trained histotechnicians
- Must span multiple scanner vendors (Leica, Hamamatsu, Philips) to avoid hardware-specific overfitting
- Class imbalance is severe: artifacts typically represent <5% of total tissue area
- Focal loss is commonly used to address this imbalance during training
- Synthetic artifact generation via data augmentation can supplement scarce real examples
Integration with MIL Pipelines
Artifact detection directly feeds into Multiple Instance Learning workflows by filtering the bag of patches before aggregation.
- Artifact patches are excluded from the bag rather than assigned a zero weight
- Prevents attention mechanisms from erroneously focusing on pen marks as diagnostic features
- Reduces computational load by eliminating 30-50% of non-informative patches
- Must operate at inference speed compatible with real-time slide analysis (<2 minutes per gigapixel WSI)
Evaluation Metrics
Artifact detection performance is measured using metrics that account for the severe class imbalance inherent in quality control tasks.
- Precision: Critical to avoid discarding viable diagnostic tissue (false positives)
- Recall: Essential to catch all artifacts that could corrupt downstream analysis (false negatives)
- F1-score at the patch level is the standard aggregate metric
- Slide-level pass/fail accuracy: Whether the system correctly flags a slide as requiring re-scanning
- Area under the Precision-Recall curve is preferred over ROC-AUC for imbalanced data
Domain Generalization Challenge
Artifact detectors must maintain performance across unseen domains—new laboratories, staining protocols, and scanner models not represented in training data.
- Stain color and intensity vary dramatically between institutions
- Stain normalization is often applied as a pre-processing step before artifact classification
- Self-supervised pre-training on diverse histology data improves out-of-distribution robustness
- Continuous monitoring for concept drift is necessary as new artifact types emerge in production
Frequently Asked Questions
Explore the critical automated quality control mechanisms that identify and exclude non-biological image regions—such as tissue folds, air bubbles, and pen marks—before diagnostic analysis begins.
Artifact detection is an automated quality control process that identifies and segments non-diagnostic regions within digitized whole slide images (WSIs) before computational analysis. These artifacts—including tissue folds, air bubbles, pen marks, blur, and out-of-focus areas—are introduced during slide preparation, staining, or scanning. The detection system typically employs a convolutional neural network trained to perform pixel-level semantic segmentation, classifying every pixel as either valid tissue or artifact. By excluding these regions from downstream tasks like tumor classification or biomarker quantification, artifact detection prevents false predictions and ensures that only high-quality tissue is analyzed. Modern implementations often use architectures like U-Net or DeepLab with custom loss functions that heavily penalize false negatives, as missing an artifact can corrupt an entire slide-level diagnosis.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Master the core techniques and quality control mechanisms that surround artifact detection in computational pathology pipelines.
Tissue Segmentation
The pixel-level classification that delineates tissue regions from the glass background on a whole slide image. This critical pre-processing step identifies the foreground area of interest before artifact detection can proceed. Segmentation masks are generated using thresholding on HSV color space or lightweight convolutional neural networks, producing binary maps that exclude empty slide areas and direct downstream analysis to tissue-containing regions only.
Stain Normalization
A computational technique to standardize color appearance across pathology images, mitigating variability from different staining protocols, scanner models, and laboratory procedures. Without normalization, a model trained at one institution may fail at another. Common approaches include Macenko's method for stain matrix estimation and cycle-consistent GANs for style transfer. Proper normalization ensures artifact detection algorithms generalize across sites rather than learning spurious color correlations.
Patch Extraction
The process of tessellating a gigapixel whole slide image into smaller, manageable tiles for processing by convolutional neural networks. Typical patch sizes range from 256×256 to 1024×1024 pixels at 20x or 40x magnification. Artifact detection often operates at the patch level, classifying each tile as usable or rejected. Efficient extraction requires handling irregular tissue boundaries and overlapping sliding windows to ensure complete coverage without redundant computation.
Data Augmentation
Techniques applied to pathology patches to artificially expand training dataset diversity and improve model robustness. For artifact detection, augmentations include:
- Rotation and flipping to handle variable tissue orientation
- Color jittering to simulate staining variation
- Elastic deformations to mimic tissue folding artifacts
- Cutout and mixing to train models on occluded regions These strategies prevent overfitting to specific artifact appearances present in limited training data.
Quality Control Pipeline
The automated workflow that filters out non-diagnostic tissue regions before analysis. A typical pipeline executes sequentially:
- Tissue segmentation to locate foreground
- Blur detection using Laplacian variance to reject out-of-focus regions
- Artifact classification to identify folds, bubbles, and pen marks
- Coverage analysis to ensure sufficient tissue remains after filtering Only patches passing all quality gates proceed to diagnostic model inference, ensuring reliable slide-level predictions.
Whole Slide Image (WSI)
A high-resolution digital scan of an entire glass pathology slide, producing a gigapixel image file typically stored in a pyramidal, multi-resolution format. Standard WSI scanners capture images at 40x magnification (0.25 microns per pixel) , generating files exceeding 100,000 × 100,000 pixels. Artifact detection must operate efficiently at this scale, often using coarse-to-fine strategies that first screen at low resolution before detailed analysis of suspicious regions at higher magnifications.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us