<figure><img src="image_1.png" /></figure>

HAL
open science

# Rapid Identification of Rice Varieties by Grain Shape and Yield-Related Features Combined with Multi-class SVM

Chenglong Huang, Lingbo Liu, Wanneng Yang, Lizhong Xiong, Lingfeng Duan

<figure><img src="image_2.png" /></figure>

► To cite this version:

Chenglong Huang, Lingbo Liu, Wanneng Yang, Lizhong Xiong, Lingfeng Duan. Rapid Identification of Rice Varieties by Grain Shape and Yield-Related Features Combined with Multi-class SVM. 9th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2015, Beijing, China. pp.390-398, 10.1007/978-3-319-48357-3_38. http-01557805

HAL Id: hal-01557805

https://inria.hal.science/hal-01557805

Submitted on 6 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_3.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Rapid Identification of Rice Varieties by Grain Shape
and Yield-Related Features Combined with Multi-Class
SVM

Chenglong Huang<sup>1,2,a</sup>, Lingbo Liu<sup>3,b</sup>, Wanneng Yang<sup>1,2,4,c</sup>, Lizhong Xiong<sup>4,d</sup>,
Lingfeng Duan<sup>1,2,e,*</sup>

<sup>1</sup>College of Engineering, Huazhong Agricultural University, Wuhan 430070, PR China

<sup>2</sup>Agricultural Bioinformatics Key Laboratory of Hubei Province, Huazhong Agricultural University, Wuhan 430070, P.R. China

<sup>3</sup>Britton Chance Center for Biomedical Photonics, Wuhan National Laboratory for Optoelectronics-Huazhong University of Science and Technology, 1037 Luoyu Rd., Wuhan 430074, P.R. China.

<sup>4</sup>National Key Laboratory of Crop Genetic Improvement and National Center of Plant Gene Research, Huazhong Agricultural University, Wuhan 430070, PR China

<sup>a</sup>hcl@mail.hzau.edu.cn, <sup>b</sup>firbo007@gmail.com, <sup>c</sup>ywn@mail.hzau.edu.cn, <sup>d</sup>lzhongx@mail.hzau.edu.cn, <sup>e</sup>duanlingfeng@mail.hzau.edu.cn

*Corresponding author

**Abstract.** Rice is the major food of approximately half world population and thousands of rice varieties are planted in the world. The identification of rice varieties is of great significance, especially to the breeders. In this study, a feasible method for rapid identification of rice varieties was developed. For each rice variety, rice grains per plant were imaged and analyzed to acquire grain shape features and a weighing device was used to obtain the yield-related parameters. Then, a Support Vector Machine (SVM) classifier was employed to discriminate the rice varieties by these features. The average accuracy for the grain traits extraction is 98.41%, and the average accuracy for the SVM classifier is 79.74% by using cross validation. The results demonstrated that this method could yield an accurate identification of rice varieties and could be integrated into new knowledge in developing computer vision systems used in automated rice-evaluated system.

**Keywords:** computer vision, rice varieties identification, grain shape, rice yield, multi-class SVM

# 1 Introduction

Rice is one of the most significant cereals in the world, especially for china (zhu et al. 2011). Thousands of rice varieties could be produced daily by modern breeding technique (Bagge and Lubberstedt, 2008). And a large number of rice germplasm-
resources need to be exploited by breeders for the rice improvement (Xing and Zhang, 2010). However, the characterization for the various rice varieties are technically challenging due to the slight difference (Takanari et al. 2012). Rice variety is also regarded as one of the most important factors related to cooking and processing quality, which was resulted by the variations in size, shape, and constitution (Zhang, 2007). Therefore rice variety identification is of great significance.

Since the identification of rice varieties is so important for rice-related research. A lot of work had been reported about it. Namaporn Attaviroj tried to identify the rough and pure rice varieties using fourier-transform NIR (Attaviroj et al, 2011). Liu Hongyun had tried to indentify rice varieties by tolerance and sensitivity to copper (Liu et al. 2007). Liu Feng tried to identify rice vinegar variety using visible and near infrared spectroscopy (Liu et al. 2011). However, the above study only focused on a few of special rice varieties, and the identification for the massive ordinary rice varieties were still an urgent problem.

Machine vision was a practical technology and had recently been widely applied in the agriculture. Dual-camera rice panicle length measuring system was proposed by Dr. Huang (Huang, 2013). A machine-vision-facility was developed for rice traits evaluation (Duan, 2011). A hyperspectral imaging system was designed for biomass prediction (Feng, 2013). Yang. Et.al applied x-ray computed tomography for rice tiller measurement (Yang, 2011). Duan et.al had counted filled/unfilled spikelets using Bi-modal imaging (Duan, 2011). Support vector machine (SVM), first proposed in 1995 by Cortes and Vapkin, has a lot of advantages, such as nonlinear, small-sample, and high dimensional pattern recognition and can be easily extended to other machine learning problems. However, since it is originally used for binary classification (Cortes, 1995; Vapnik, 1999), it requires extra algorithm support to meet practical needs.

This research aimed to propose a feasible method for rapid identification of rice varieties. In this study, the features of grain shape and yield-related traits were extracted by image analysis. And the specific Muti-SVM classifier was developed to discriminate the rice variety.

## 2 Materials and Methods

The Rice varieties used in this study are selected from the Chinese core-germplasm resources. 79 rice varieties were tested and each variety had four samples. Three quarter of the rice samples were taken as training set, meanwhile the other were testing set. The rice grains were threshed from the panicles manually. And the filled spikelets were selected out by wind separator.

The technical method for rice variety identification is described as Fig.1. Firstly, the rice grain were imaged and analyzed for shape and weight parameters. Then features of the training set were applied to build the SVM model. With the SVM model, the testing set was applied to evaluate the rice variety identification accuracy.
<figure><img src="image_4.png" /><figcaption>Fig. 1. The technical method for rice variety identification</figcaption></figure>

## 2.1 Rice feature extraction

The features of each rice sample were obtained as shown in Fig. 2. The rice grains per sample were spread on the scanner manually (Fig. 2a). And the image was acquired and transferred to the computer. Then grain image was analyzed for grain number (GN), grain width (GW), grain length (GL), grain area (GA) (Fig. 2b, 2c). And the grain weight was obtained by the electro-weighing device (Fig. 2d).

<figure><img src="image_5.png" /><figcaption>Fig. 2. Rice grain features acquisition</figcaption></figure>
## 2.2 Multi-SVM Classifier

Since we focus on the classification of rice varieties, we should know the biological classification criteria of rice. Generally, different type of rice will have different genotypes, which usually leads to different phenotypes. Obviously, one of the important problems is how to divide the training rice samples into different subsets by binary tree based SVM-BTA algorithms. When it comes to plants classification, we wish the two subsets will have at least one totally different genotype. Knowing the fact that disparate varieties all have different genotypes, one possible way is using the K-Means clustering method, which will resign each data to the nearest cluster repeatedly, just like combining analogous genes. The problem is to determine the evaluation function.

In order to reduce the algorithm running time of the partitioning process, it's necessary to improve the KMeans clustering. Since we always want to divide the input set into two clusters, a pretreatment of the data using average threshold algorithm will work. In the next section, we introduce one partition function for evaluation, and then propose MBT-SVM based on the K-Means clustering with optimal partition function.

### 2.2.1 Partition function

Suppose the problem's center $c_{problem}$ as the alldata mean value in the i.th column of the input of a non-leaf node. The following partition function can be adopted to split the node [9]:

$$PF(I_1 \cup I_2) = \sum_{j=1}^{2} \sum_{i=1}^{l} \frac{d(c_i, c_{problem})}{\sigma_i} \quad (1)$$

Where $d(c_i, c_{problem})$ is the Euclidean distance and $\sigma_i$ is the variance of column i.

The larger PF is, the better it works. So we have also determined our termination criterion, just to traversal all the possible combinations to find the largest PF, or to reassign the object one by one until the value PF won't become larger in a whole round. An initial partition is needed to reduce the algorithm running time. The judging function using average threshold algorithm was described as followed:

$$J(x) = \begin{cases} 1, & \sum_{i=1}^{v} x_i \ge \frac{1}{l} \sum_{j=1}^{l} \sum_{i=1}^{v} x_{ij} \\ -1, & \text{else} \end{cases} \quad (2)$$

Where v is the number of features. And $x_{ij}$ is the i.th feature of the j.th sample in the training set.

The judging function compares the average value of all the features of a sample with the average value obtained by the whole training set. Since different features of the
rice will have different magnitude, we have to standardize the input data. The standardization includes data integrity check, linear unification and repacking.

## 2.2 Kernel function

The efficiency and accuracy of SVM is determined by the kernel type and parameters, as well as the parameter c. To determine the best type of kernel function, we can try the three basic kernel functions and pick the one with the best accuracy according to cross-valid. In general, the Gaussian kernel with a single parameter γ is a good choice. The c and γ is usually calculated by a grid searching method, in which the cross validation is applied, then we will pick the one with the highest accuracy, such as $c = \{2^{-5}, 2^{-4}, 2^{-3}, ... 2^{8}\}, \gamma = \{2^{-10}, 2^{-9}, 2^{-8}, ... 2^{3}\}$. The final model, will then training set was applied by the chosen type of kernel function and with the optimized parameters [10]. As is shown in Fig.3, an inappropriate combination of kernel type and parameters will cause under-fitting or over-fitting problems.

<figure><img src="image_6.png" /><figcaption>Fig. 3. Classification models generated by different kernel type and parameters</figcaption></figure>

# 3 Results and Discussion

## 3.1 Grain traits extraction accuracy

Totally, 79 copies of rice grains were measured automatically and manually, and the parameters of the GN, GL, GW, GA, grain weight were all obtained for each copy. The measurement accuracy for each traits were shown in Fig. 4, the MAPE were calculated according to the eq.1.

$$MAPE = \frac{1}{n} \sum_{i=1}^{n} \frac{|x_{ai} - x_{mi}|}{x_{mi}} \quad (eq.1)$$
<figure><img src="image_7.png" /><figcaption>**Fig. 4** System measurements accuracy evaluation. (a) Grain number, (b) Grain length, (c) Grain width.</figcaption></figure>

The measurement results showed that the average MAPE for grain number measurements was 1.33%; the average MAPE for grain length measurement was 1.25%; the average MAPE for grain width measurement was 2.20%. The results demonstrated that the automatical measurements performed a good relationship with manual measurements.
## 3.2 Rice varieties identification

The rice feature measurements were shown above. From the results, it was proved that the difference between outer-varieties and inner-varieties were both slight. In the SVM identification, for each tree node, an RBF-kernel SVM was first adopted after partitioning the input data by a clustering method and the linear function was the last one to try. A grid search based on cross-validation was employed for parameter optimization. The result for the whole experiment is shown in table1. The training time includes partitioning, tree construction and SVM training. It represented the CPU running time (millisecond), for a quad core computer, the real-time approximately equals to a quarter of the CPU time.

The standard data from UCI and the rice sample data were all tested and the classifying results were shown in table 1. It was proved that the algorithm had high classification accuracy when processing these standard data. Since the testing samples are randomly selected, every kind of data set was tested only three times and the worst result was recorded in order to avoid anthropogenic interference (like continually running the algorithm until it gets a good output). From the data associated to rice in table 1, it was seen that building a classification binary tree for a set of data with many classes needed a relatively long time.

Rice-s79-1 is a basic pre-experiment focusing on verification of the algorithm compatibility. There was not a linear kernel function and the number of attributions was fixed to 13. Rice-s79-2 was a grid-search experiment aiming at finding a suitable number of attributions for the next experiment. Since the algorithm needed to traverse all the possible combinations of the attribution, and there were four kernel functions to be examined for each combination, it's naturally to have a very large training time (nearly ten hours of real-time). After tracking the misclassified samples, we find that about half of the errors occurred in the tree nodes with a relatively high cross-valid accuracy other than the low ones. Clearly, the model is over-fitted. It is necessary to improve the optimization function. We needed to pick the SVM classifier with an appropriate cross-valid accuracy instead of the ones with the highest. Rice-s79-3 was the result of the formal experiment. As was mentioned above, we repeat the experiment three times and record the result with the worst accuracy rate. And the average accuracy was about 79.74%.

<table><caption>Table 1 the class identification results by Muti-SVM</caption><thead><tr><th>data</th><th>class</th><th>dimensions</th><th>size</th><th>training set</th><th>testing set</th><th>accuracy</th><th>Training time (CPU time ms)</th></tr></thead><tbody><tr><td>iris</td><td>3</td><td>4</td><td>150</td><td>120</td><td>30</td><td>100%</td><td>0.875</td></tr><tr><td>wine</td><td>3</td><td>13</td><td>178</td><td>133</td><td>45</td><td>97.78%</td><td>28.03</td></tr><tr><td>seeds</td><td>3</td><td>7</td><td>210</td><td>100</td><td>110</td><td>96.67%</td><td>161.03</td></tr><tr><td>vehicle</td><td>4</td><td>18</td><td>846</td><td>746</td><td>100</td><td>86%</td><td>213.07</td></tr><tr><td>glass</td><td>6</td><td>9</td><td>214</td><td>166</td><td>48</td><td>72.91%</td><td>321.04</td></tr><tr><td>rice s79-1</td><td>79</td><td>13</td><td>316</td><td>237</td><td>79</td><td>64.56%</td><td>1226.6</td></tr><tr><td>rice s79-2</td><td>79</td><td>13</td><td>316</td><td>237</td><td>79</td><td>25.32%</td><td>124457</td></tr><tr><td>rice s79-3</td><td>79</td><td>13</td><td>316</td><td>237</td><td>79</td><td>79.74%</td><td>55108</td></tr></tbody></table>
## 4 Conclusions

In this paper, a support vector machine working in the multi-space-mapped mode (MBT) was proposed for a rice multi-class classification task. The result showed that this study performed high accuracy for the grain traits extraction and also proved a good performance for the rice varieties classification. In future work, we will further analyze the data of tree nodes from experiments to develop more effective algorithms. The range of the parameters will change according to the size of the input training set which will greatly reduce the computation time, which will reduce the time complexity of the algorithm. Therefore we could apply this method for larger rice sample sets for varieties recognition. The results also demonstrated that this method would provide new knowledge for automated rice-vision-evaluated system.

## Acknowledgment

This work was supported by the Fundamental Research Funds for the Central Universities (2662014BQ036, 2662015QC006, and 2662015QC016), the Natural Science Foundation of Hubei Province (2015CFB529), the National High Technology Research and Development Program of China (2013AA102403), the National Natural Science Foundation of China (30921091, 31200274).

## References

1. Bagge, M., Lubberstedt, T., 2008. Functional markers in wheat: technical and economic aspects. Molecular Breeding 22 (3), 319-328.

2. Zhu, J., Zhou, Y., Liu, Y., Wang, Z., Tang, Z., Yi, C., Tang, S., Gu, M., Liang, G., 2011. Fine mapping of a major QTL controlling panicle number in rice. Molecular Breeding 27, 171-180.

3. Xing, Y., Zhang, Q., 2010. Genetic and molecular bases of rice yield. Annual Review of Plant Biology 61, 11.1-11.22.

4. Tanabata, T., Shibaya, T., Hori, K., Ebana, K., and Yano, M., 2012, SmartGrain: High-Throughput Phenotyping Software for Measuring Seed Shape through Image Analysis, Plant Physiology 160, 1871-1880.

5. Liu, H., Zhang, H., Wang, G., and Shen, Z., 2007, Identification of Rice Varieties with High Tolerance or Sensitive to Copper, Journal of Plant Nutrition 31:1, 121-136.

6. Liu, F., Yusuf, B., Zhong, J., et al, 2011, Variety Identification of Rice Vinegars using visible and near infrared spectroscopy and multivariate calibrations, International Journal of Food Properties 14:6, 1264-1276.

7. Zhang, Q.-F. 2007. Strategies for developing green super rice. PNAS 104(42): 16402-16409.

8. Attaviroj, N., Kasemsumran, S., and Noomhorm, A., 2011, Rapid Variety Identification of Pure Rough Rice by Fourier-Transform Near-Infrared Spectroscopy, Cereal Chemistry 88(5): 490-496.

9. Huang, C. et al, 2013, Rice panicle length measuring system based on dual-camera imaging, Computer and Electronics in Agriculture 98: 158-165.
10. Duan, L. et al, 2011. A novel machine-vision-based facility for the automatic evaluation of yield-related traits in rice, Plant Methods 7: 44.

11. Feng, H. et al, 2013, A hyperspectral imaging system for an accurate prediction of the above-ground biomass of individual rice plants, Review of Scientific Instruments 84, 095107.

12. Duan, L. et al, 2011, Fast discrimination and counting of filled/unfilled rice spikelets based on bio-modal imaging, Computers and Electronics in Agriculture 75: 196-203.

13. Yang, W., Xu, X., Duan, L., Luo, Q., Chen, S., Zeng, S., Liu, Q., 2011. High-throughput measurement of rice tillers using a conveyor equipped with x-ray computed tomography. Review of Scientific Instruments 82, 025102-1-025102-7.

14. Cortes, C., Vapnik, V., 1995, Support-vector networks, Mach. Learning 20: 273-297.

15. Vapnik, V., 1999, an overview of statistical learning theory, IEEE Trans. Neural Networks 10(5): 988-999.

16. Kumar, M., Gopal, M., 2011, Reduced one-against-all method for multiclass SVM classification, Exp. Syst. Appl. 38:14238-14248

17. Hsu, C., Chang, C., and Lin, C., 2003, A Practical Guide to Support Vector Classification. Department of Computer Science and Information Engineering, National Taiwan University.