1. A method for identifying a pattern in an image, comprising the steps of normalizing the image to a binary matrix, generating a binary vector from the binary matrix, filtering the binary vector with a sparse matrix using a matrix vector multiplication to become a feature vector, creating with the feature vector a density of probability for a predetermined list of models, selecting a model with the highest density of probability as the best model, and classifying the best model as the pattern of the input image, wherein the matrix vector multiplication is an approximate matrix vector multiplication including only the elements of the binary vector which are not zero and including only the elements of the sparse matrix which are higher than a predetermined value.