Layered recognition networks that pre-process, classify, and describe