1. A method to classify an input image, comprising a. determining a spatial-pyramid image representation based on sparse coding; b. determining a descriptor for each interest point in the input image; c. encoding the descriptor; and d. applying max-pooling to form the spatial pyramid representation of images.