Dual Representation Learning for Out-of-Distribution Detection