Diversification And Generalization For Metric Learning With Applications In Neuroimaging