Robust Visual Recognition Using Multilayer Generative Neural Networks