In the scientific and commercial fields associated with modern agriculture, the categorization of different rice types and determination of their quality is very important. In the recent years, various image processing algorithms have been applied to detect different agricultural products. The problem of rice classification and quality detection is presented in this paper based on the model learning concepts including the 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 available to represent the structural content of rice varieties. In order to achieve the desired results, different features from the recorded images are extracted and used to learn the representative models of rice samples. Also the sparse principal component analysis and sparse structured principal component analysis are employed to reduce the dimension of classification problem, which leads to an accurate detector with a 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. The 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.