How to make binary activation function

Hi all,

I am working on binary images, and I don’t want to change a binary image to a gray image after passing the network. Could you know me how to make a binary activation function? Thanks you!

a discrete activation function has no gradient a.e.