I have a set of paired binary images X,Y and an external function that I don't have access to, which receives X as input and outputs the binary image W.
I want to develop a neural network that can transform X into X_optimal such that after passing it to the external function I can minimize |Y-W|.
The external function can only receive binary images and it outputs binary images so X_optimal has to be another binary image, the problem with this is that normally the output of a neural network is between 0 or 1 and if I apply a threshold then I cannot backpropagate through the network because it is non-differentiable.
Please I would like to have some intuition on how to start my network architecture or if you know some papers that I can read it would be really helpful