GitHub repository for the augmentation described in "Clustering-based Stain Augmentation: Templates for Periodic Acid-Schiff Biopsy Images".
Paper Link:
In computational pathology, stain augmentation is one of the key approaches to produce deep learning models that are more generalizable and invariant to the types of stain variation that often exists between laboratories. However, achieving realistic augmentations typically requires knowledge about the target domain characteristics, the modeling of which depends on access to large and varied reference datasets. Access to such data is often limited and dataset sharing is restricted due to privacy regulations, severely hampering the ability of research groups to establish diverse and representative augmentation baselines. To overcome this issue, the current project suggested to establish augmentation templates that are more easily shared between research groups. For this purpose, Periodic acid-Schiff stained images from over 14 different sources were collected and utilized to establish a stain style-related (RandStainNA) and a stain vector-related augmentation template.
This GitHub repository contains these two augmentation templates as well as the code for producing new augmentations. Augmentations can either be achieved using the RandStainNA tool (using the stain style template). We are also introducing the PASAugmentor, a bespoke tool for creating augmentations from the stain vector-related augmentation templates. Both augmentation methods allow optional removal of background pixels prior to augmentation.
For more details on the use of PASAugmentor refer to PASAugmentor.py, Notebook pipeline example.ipynb and Notebook disk example.ipynb
transforms_list = [
stain_augmenter_method = "PASAugmentor"
PASAugmentor(stain_augmenter=stain_augmenter_method,mode='Random', p=1, background_removal=False)
]
transforms.Compose(transforms_list)
The results here are in part based upon data generated by (i) the Kidney Precision Medicine Project, (ii) the HuBMAP program, and (iii) the Norwegian Renal Registry
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

