The Pathology AI Library

The library

torchstain

Stain normalisation as a differentiable, GPU-capable operation.

Cost
Free
Hardware
Runs on any laptop
Offline
Works without a connection
Scanner
Not required
Your data
Stays on your machine
Licence
MIT
Maturity
production
Source code

What it is

Implements the standard stain normalisation methods (Macenko, Reinhard, Vahadane) in PyTorch, TensorFlow and NumPy so normalisation can sit inside a training pipeline rather than as a preprocessing step.

Caveats

Normalisation reduces but does not eliminate inter-laboratory variation โ€” see the stain and scanner variability entry before assuming it solves domain shift.

Licence notes

Check the repository before any reuse.

Activity: 188 stars ยท last commit 2025-11-13 โ€” refreshed nightly

Related

Catalogued 2026-08-02, last checked 2026-08-02. View the source record ยท Report an error