title: Is there an optimizer in keras based on precision or recall instead of loss?
body: <p>I am developping a segmentation neural network with only two classes, 0 and 1 (0 is the background and 1 the object that I want to find on the image). On each image, there are about 80% of 1 and 20% of 0. As you can see, the dataset is unbalanced and it makes the results wrong. My accuracy is 85% and my loss is low, but that is only because my model is good at finding the background !</p>
  
  <p>I would like to base the optimizer on another metric, like precision or recall which is more usefull in this case.</p>
  
  <p>Does anyone know how to implement this ?</p>