Robust Classification with Context and Rejection