A novel image classification method is proposed based on the sparse representation. The initial dictionary consists of the feature patches obtained through the feature extraction. The K-SVD algorithm is adopted to update the dictionary. Each dictionary is learned from the images of each category, and the images of this category can be represented sparsely over this dictionary. The classification can be achieved in terms of the projection error. Experimental results show that the proposed method achieves the comparable performance.