funkelab / gunpowder

A library to facilitate machine learning on multi-dimensional images.
https://funkelab.github.io/gunpowder/
MIT License
79 stars 56 forks source link

Channel-wise intensity augment #216

Open MariaTheiss opened 21 hours ago

MariaTheiss commented 21 hours ago

Hi! I use Gunpowder for H&E pathology images, which often suffer from inconsistent staining and illumination. These are typically three-channel images, where channels are (R, G, B); or (Hematoxylin, Eosin, Residual). I augmented the images with gunpowder.IntensityAugment() to avoid overfitting on this inconsistent staining. However, to my knowledge, gunpowder.IntensityAugment only changes the overall intensity of a patch.

It would be amazing if it were possible to change the intensity of the individual channels, i.e., the color of a patch. This would also benefit other types of multi-channel images, such as fluorescence microscopy images. Ideally, controlling the amount of change in each channel should be possible.

Thank you!

pattonw commented 21 hours ago

Yes I have run into this need before and have written a node to do it, I'll see about adding it to the built in nodes