How to create a custom loss function from sklearn metrics in Keras?
Use the cross-entropy loss function.  That is already built into Keras, and while you haven't defined exactly what you mean by "mutual information metric", if it's what I suspect you mean, it is equivalent to the cross-entropy loss.