## 3 Results and Discussion
### Classification Performance  
The features extracted from processed training images were used to build the ANFIS model. Test error was found to be on training data for 20 epochs during ANFIS training (Figure 8). The error was zero for test data after thresholding (threshold at 2) on ANFIS output. The results of training and testing are quite impressive as shown in Figure 8 and it is further analyzed in Table 1.  
From Table 1 it is observed that for the majority of the objects (rice grains in test image) the ANFIS output threshold class is similar to actual class (i.e., 0 or 1). Therefore, the classification accuracy of ANFIS is 100%, as an actual class and ANFIS output class for the test objects are alike.  
Here it is important to note that the proposed approach categorizes basmati rice grains into two categories: (1) whole grain and (2) broken grain. Perhaps the readers can imagine what happens with imperfect grains or the imperfect whole grain? For an imperfect grain, the morphological parameters are different from a whole grain. The present study considers a binary classification ('whole grain' = 1, 'broken grains or/and others' = 0). The membership function is taken as 'High' and 'Low' (cf. Section 2.5). For an imperfect grain eccentricity will be 'low', (_a/b_) is 'low'. Perimetermight be'medium'. However, in our case membership function is set to 'High' and 'Low'. Therefore, it will be classified as 'broken grain'. By virtue of these, imperfect grain anyhow is separated from 'whole grain', thus it is not affecting'milling efficiency'. Figure 9 illustrates a similar scenario which is analyzed from a test image. It is clearly showing a dissimilarity between grain physical parameters for three-grain types.  
Figure 8: Training and test error for sample images. During training, after 11 epochs the error significantly reduces. In test error plot, the blue dots are actual output, and the red stars are ANFIS output corresponding to each object.  
Figure 7: Image processing outputs. (**a**) Raw sample image (RGB); (**b**) Red channel image; (**c**) Green channel image; (**d**) Blue channel image; (**e**) Binary image; (**f**) Image after morphological opening; (**g**) Hole filled and border cleared image; (**h**) Labelled objects in training sample1 image; (**i**) Labelled objects in training sample 2 image; (**j**) Labelled objects in training sample 3 image; (**k**) Labelled objects in training sample 4 image; (**l**) Labelled objects in test sample image.  
From the experimental results, it is observed that the ANFIS perform satisfactorily in evaluating the percentage of broken rice with an overall accuracy of \(>\)98.5%. However, the comparative analysis with the SVM and KNN are less favourable with accuracies \(<\)95% for 10 test images as shown in spider plot in Figure 10.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Object Label** & **Actual Class** & **ANFIS Output Class** &
\begin{tabular}{c} **ANFIS Class** \\ **Output Thresholded** \\ \end{tabular} \\ \hline  
\hline \hline \end{tabular}
\end{table}
Table 1: ANFIS results for test image for each rice object. Threshold is applied with rule: If (ANFIS output class \(>\) 2) Then (ANFIS output class thresholded = 0).  
Figure 9: Variations in features in between different grains. (**a**) Whole rice grain; (**b**) Broken rice grain; (**c**) Imperfect rice grain.