Improving Efficiency and Generalization of Visual Recognition