Learning and adapting visual models for multiple specialized tasks