Learning Topological Representations for Deep Image Understanding