1. A method implemented by data processing apparatus, the method comprising: detecting a plurality of edges in an image under different value combinations of one or more model feature dimensions; calculating a measurement of similarity distance of each of the detected edges from one or more image patches in an image patch library, each of the image patches having values representing the model feature dimensions; creating a first image vector space, each data point in the first image vector space being based on the measurements of similarity distance of detected edges from a specific image patch in the image patch library and representing a minimal similarity distance of the image from the specific image patch; dividing the image into a plurality of first sub-images; comparing each first sub-image, using values representing one or more data feature dimensions in the first sub-image, with a plurality of second sub-images in a sub-image library to determine which second sub-images are within a threshold of similarity to the first sub-image, each of the second sub-images having values representing the data feature dimensions; creating a second image vector space, each data point in the second image vector space representing a number of first sub-images that are within the threshold of similarity to a second sub-image; combining the first and second image vector spaces and mapping the combination to an object vector space in a plurality of object vector spaces, each object vector space being labeled; and associating the image with the label of the mapped object vector space.