In scientific and commercial fields associated with modern agriculture, the categorization of different rice types and determination of its quality is very important. Various image processing algorithms are applied in recent years to detect different agricultural products. The problem of rice classification and quality detection in this paper is presented based on model learning concepts including sparse representation and dictionary learning techniques to yield over-complete models in this processing field. There are color-based, statistical-based and texture-based features to represent the structural content of rice varieties. To achieve the desired results, different features from recorded images are extracted and used to learn the representative models of rice samples. Also, sparse principal component analysis and sparse structured principal component analysis is employed to reduce the dimension of classification problem and lead to an accurate detector with less computational time. The results of the proposed classifier based on the learned models are compared with the results obtained from neural network and support vector machine. Simulation results, along with a meaningful statistical test, show that the proposed algorithm based on the learned dictionaries derived from the combinational features can detect the type of rice grain and determine its quality precisely.