Skip to content

patologiivest/PASAugmentor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PASAugmentor

GitHub repository for the augmentation described in "Clustering-based Stain Augmentation: Templates for Periodic Acid-Schiff Biopsy Images".

Paper Link:

Background

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.

Material and methods

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.

Figure 1: Illustration of augmentations. An example glomerulus (top) is randomly augmented 100 times either with the RandStainNA (bottom left) or the PASAugmentor (bottom right). Both augmentations employ background removal to focus color shifts only to foreground pixels. The RandStainNA is run using the uniform distribution setting.
Figure 1: Illustration of augmentations. An example glomerulus (top) is randomly augmented 100 times either with the RandStainNA (bottom left) or the PASAugmentor (bottom right). Both augmentations employ background removal to focus color shifts only to foreground pixels. The RandStainNA is run using the uniform distribution setting.

Use in Data Augmentation Pipelines

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)

Acknowledgments

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

License

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

About

GitHub repository for the augmentation described in "Clustering-based Stain Augmentation: Templates for Periodic Acid-Schiff Biopsy Images" [MICCAI / SASHIMI Workshop 2025].

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages