Learning quantification from images: A structured neural architecture