1. A method for generating an image representation comprising: generating a set of embedded patch descriptors, comprising, for each of a set of patches of an image, extracting a patch descriptor which is representative of the pixels in the patch; and embedding the patch descriptor in a multidimensional space to form an embedded patch descriptor; generating an image representation comprising aggregating the set of embedded patch descriptors, wherein in the aggregation, each patch descriptor is weighted with a respective weight in a set of weights, the set of weights being computed based on the patch descriptors for the image; and outputting information based on the image representation, wherein at least one of the extracting of the patch descriptors, embedding of the patch descriptors, generating the image representation, and outputting information is performed with a computer processor.