AI system for digital pathology: WSI, MIL, attention heatmap

Manual glass slide review does not scale: attention drifts, and conclusions diverge. We develop turnkey digital pathology systems — from slide digitization to an attention map that highlights suspicious areas for the physician. Slide stream review accelerates many times over, and reproducibility of conclusions increases.
Frequently Asked Questions

Digital pathology: where manual slide analysis breaks down

Digital pathology began as an add-on to the microscope: a slide is scanned at high resolution, producing a whole-slide image that can be navigated, zoomed into regions, and reviewed by two people over the network.

This reduces the load on the optics, but the review itself remains manual — the image is read by a specialist, and the tool only helps with scrolling.

The process breaks down at scale. A single scan contains tens of thousands of fragments at magnification where cellular structures are discernible, and the key region may occupy fractions of a percent of the area.

Histological image analysis turns into a search for a needle in a haystack: the pathologist reviews field after field, holding previous context in memory, and a region at the edge of the frame is easy to miss.

The second bottleneck is reproducibility. Specialists look at different fields and digitize criteria differently, so inter-specialist variability on borderline categories is noticeable, and a repeat review of the same slide yields a different conclusion. Fatigue and monotony amplify variability: selection of the region of interest becomes subjective.

Hence the queue of unprocessed studies grows. Time goes to routine cases that still require a look, while complex ones wait alongside them, and priority is set manually. Turnaround time increases due to mechanical review, not reasoning.

We examine how this is addressed: fragments instead of the whole slide, an attention map as a hint, and variability as a measurable quantity.

What automation of histological image review provides

Converting histology to digital form changes not the diagnosis but the workflow for a stream of scans. A slide is digitized in full, the model marks regions of interest, and provides the physician with an attention map — the areas to review first. Review no longer depends on the order in which slides landed on the desk.

Preliminary sorting and priority for urgent cases

The classifier evaluates each study by urgency features and builds a queue: suspected invasive growth or a small amount of material goes to the top, while planned biopsies go into the general flow.

The physician opens not a random slide from the stack but the next one by priority, so time to conclusion for critical cases is reduced from hours of waiting to the first review.

Study prioritization is set by rules: the trigger threshold and categories that the model is not allowed to downgrade.

Reducing the share of missed foci

The model traverses the entire slide, not just the area selected by the eye, so small foci and regions at the edge of the section do not drop out of view.

Each conclusion is accompanied by an attention map and a confidence estimate, so questionable areas are visible before they become a miss.

Reproducibility of conclusions provides a second opinion: a repeat run on the same scan returns the same result, and discrepancies are recorded for review.

We perform acceptance testing on the clinic's own material according to professional community methodologies — College of American Pathologists: the system is considered operational when it reproduces physicians' conclusions on a labeled sample.

Digital pathology formats: slide, region, model ensemble

The format in which material is presented determines what the model will see at all.

The same specimen can be submitted as a whole slide, as a set of fragments, or as individual regions of interest — and each option hits its own trade-off between detail, computational volume, and robustness of the conclusion.

Whole-slide analysis

The whole slide provides context: where the focus is relative to the section edges and resection margins, and which areas are worth looking at at all.

The model does not lose a rare region but pays for it with reduced detail — small structures break apart at reduced magnification. This is the first pass: it produces an attention map and outlines areas for the second stage.

Review of selected regions of interest

Regions of interest are processed at native magnification — nuclei, mitoses, and cell borders become discernible. Accuracy on local features is higher, but without slide-level aggregation the verdict is based on a fragment and loses connection with the overall picture. When there are dozens of such regions, batch processing keeps response time predictable.

Option When it fits Limitations
Whole slide, reduced magnification Rapid triage, navigation through the specimen Small structures are lost
Fragments with slide-level aggregation Every region of the section matters Computational volume, attention map needed
Regions of interest at native magnification Nuclei and mitoses counting, fine morphology Depends on quality of region selection
Model ensemble and cascade Different magnifications and tissue types Reproducibility is more difficult

In practice, formats are combined: the whole slide defines the attention map, regions refine it, and the ensemble reduces variability between models.

Slide-level aggregation brings everything into a single verdict, and batch processing allows a stream of studies to be run without manual intervention on each one.

How implementation is structured: data audit, design, validation, handover

Implementation begins not with the model but with an audit of the archive: how many studies are digitized, how whole-slide images are stored, which stains are represented, and what share of cases have a confirmed physician conclusion.

This slice shows whether there is enough material for the required classes and what will have to be additionally labeled.

  1. Data audit: archive volume, uniformity across stains, digitization quality, share of confirmed diagnoses.
  2. Solution design: what is fed as input, how slide fragments are aggregated, which classes the model distinguishes, and where it fits into the pathologist's work.
  3. Training on a reference sample labeled by several physicians.
  4. Validation on an independent sample — discussed below.
  5. Agreement on trigger thresholds — discussed below.
  6. Pilot in the department: the model runs in parallel with the physician, and discrepancies are reviewed manually.
  7. Handover to operation: integration with the laboratory system, decision log, update procedure, staff training.

Validation on an independent sample

We split the training and validation parts by patients, not by individual fragments: otherwise sections from one case end up in both samples and metrics are inflated.

We separately examine sections from another scanner and rare classes — that is usually where the drop appears that needs to be closed before the pilot.

Agreement on trigger thresholds

The threshold sets the balance: at high sensitivity the physician receives more suspicions, at low sensitivity there is a risk of missing a case.

We select it on the validation sample together with pathologists and fix it in documentation so that after a model update the system's behavior does not change unnoticed.

What remains with you: models, designs, procedures, documentation

A digital pathology project makes sense only when, after delivery, the system remains in your hands: you can retrain the model, change the trigger threshold, or hand support to another team without archaeological excavations in someone else's code.

Therefore, the delivery package includes not reports and presentations but engineering artifacts — with versions, described inputs and outputs, and applicability boundaries.

  • Model weights — trained weights in a portable format, with checksums, metrics on a hold-out sample, and a fixed threshold below which a case goes to specialist review.
  • Data processing design — the path from slide scanning to a ready conclusion: where whole-section images are stored, how fragments are cut, how scores are aggregated per image, and what happens on failure at each step.
  • Access policy — user roles, separation by study and patient, logging of data access, and rules for export outside the perimeter.
  • Review procedure — how the physician reads the model's attention map, under what discrepancies a second review is triggered, and what is recorded in the conclusion.
  • Solution documentation — architecture diagram, service contracts, deployment instructions, and the procedure for rolling back to a previous model version.
  • Validation set — fixed data and test scenarios that reveal quality degradation after further training or a scanner change.
  • Instructions for specialists — short guides for the laboratory and IT service, including the incident escalation procedure.

Materials are transferred to your repository and your infrastructure — without being tied to us. Further training on new data, expansion to another research direction, or a complete change of contractor do not require contacting the authors of the system.

Case study: slide review in a stream and increased reproducibility

The pilot ran on a single stream — biopsies and surgical material. Slides were scanned on Leica Aperio, then sent to the system: the model marked regions of interest itself, and the pathologist worked from a ready heatmap.

Before implementation, the same stream was reviewed entirely manually, and we spent two weeks collecting baseline metrics — otherwise there is nothing to compare “before” and “after” against.

Metrics before and after implementation

Metric Before After
Time per study 11–14 min 5–7 min
Share of repeat slide reviews 31% 8%
Agreement between two specialists' conclusions 0.61 0.83

Repeat reviews fell not because of speed but because the map immediately shows priority fields — there is less need to return to the specimen to “finish reviewing.” We calculated agreement on a sample independently reviewed by two pathologists: discrepancies remained mainly where the model's confidence is low, and such cases now automatically go to a second opinion.

What we reworked during the project

  • We abandoned scoring by individual fragments in favor of slide-level aggregation — the model stopped losing small foci against the background of large ones.
  • We rebuilt the training sample: we returned to it cases where the model was confidently wrong, not just disputed ones.
  • We introduced a confidence threshold and a review queue — questionable cases do not drown in the general flow.
  • We made the map overlay on the slide adjustable in transparency: the pathologist simultaneously sees both the hint and the original tissue.

Pilot result: the stream of studies proceeds without increasing the load on specialists, and all disputed observations are reviewed in a separate list.

How does whole-slide analysis differ from fragment review?

Fragment review is a fixed-size sliding window: the model sees a tissue region, gives an answer for it, and does not know what is happening in the rest of the specimen.

Whole-slide analysis cuts fragments across the entire area and assembles a decision from them with a single aggregating layer. Formally, this is learning on “bags” of fragments, where the label is known at the slide level rather than the individual region.

Labeling requirements differ by an order of magnitude.

Per-fragment masks are hours of pathologist work and discrepancies between annotators, whereas a slide-level label is taken from an ordinary conclusion: the model is further trained on what has already accumulated in the laboratory system.

Explainability is where the slide approach wins definitively. The attention map is overlaid on the specimen, and the pathologist sees which regions influenced the conclusion by opening the slide in QuPath or a compatible viewer.

Fragment review gives a list of independent answers that must be manually combined into a diagnosis.

Accuracy, labeling, and integration with the laboratory system

The customer checks not the model but how it behaves on their specimens, their scanner, and their streams. Below are the most common concerns: labeling quality, equipment changes, new finding classes, explainability of conclusions, and drift control.

How is labeling quality checked?

Labeling is performed by pathomorphologists, disputed cases go to a third expert, and agreement between them is measured before training starts.

The attention heatmap shows which fields of the specimen the conclusion relies on — this is a check by the physician's eyes, not only by a metric.

What happens when the scanner changes?

The color profile and image geometry differ between scanners: calibration is performed on reference specimens, and on a sample from the new equipment, acceptance testing is done before it is put into operation. Until metrics are confirmed, the previous workflow remains operational.

How are new finding classes added?

A new class is introduced without rebuilding the system: the patch-bag architecture accepts additional labeling, after which we check that previously learned classes have not degraded.

How is drift controlled?

We monitor the distribution of conclusions and the share of cases sent for review, and compare them with conclusions. When a shift occurs, an alert is triggered, and further training uses accumulated material.

How will the system integrate with the laboratory system?

The result is linked to the study and returned to the laboratory workflow without manual entry. Integration with the laboratory system is agreed upon at the design stage — together with export formats and access rights.

Let's discuss the task: send slide examples and the current process

To make the conversation substantive, several things should be prepared for discussing the task. The estimate and work plan rely on your data and current review process, not on general ideas about how a laboratory is organized.

  • 5–10 digital slides in original form — with an image pyramid and scanner metadata: they show how the model behaves at different magnifications.
  • Current review process: who reviews the slide and at what stage, where the label is placed, how discrepancies between physicians are resolved.
  • Labeling from physicians, if available: in what form, confirmed by whom, which cases are disputed — without it there is nothing to discuss quality metrics with.
  • Nosologies and magnification levels at which the diagnosis is significant: architecture and computational volume depend on them.
  • Data and access limitations: where slides are stored, how they are exported, what anonymization requirements apply.
  • Pilot composition: sample size, which physicians provide feedback, which sensitivity and false-positive thresholds we consider acceptable.

Describe the task in free form — what you have already tried and where the bottleneck is. We will return with an estimate and work plan: stages, pilot composition, and timelines for the first result.

AI Development Areas

Latest works

  • B2B ADVANCE company website development
    B2B ADVANCE company website development
    1542
  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1393
  • Website development for BELFINGROUP
    Website development for BELFINGROUP
    1081
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1368
  • B2B Advance company logo design
    B2B Advance company logo design
    815
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1139