Learning Robust Features And Metrics For Image Classification And Matching