## 3 Application of the Proposed Method to the Fruit Variety Classification
### Results and Discussion
#### 3.4.2 Proposed Fruit Classification Method Using the Certainty Factor  
The proposed fruit classification method was tested for the same dataset with six different apple varieties. In this method, one photo classification was associated with classifications of a few images (one original image and ROI images). The amount of testing data according to the number of images for one photo classification is presented in Figure 2. It is evident that the most cases (364 photos) concerned the classification of an apple based on one original image and one ROI image (this was a photo with one apple or a photo on which the YOLO method detected only one apple object). In the dataset, there were photos for which the YOLO method failed to identify any fruit (five photos). The YOLO method detected the most fruits (as many as 11) in four cases. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**No.** & **Image** & **Result Obtained** & **Correct Result** \\ \hline \multirow{3}{*}{1} & & variety of B & \\  & & (the probability of the sample & variety of A \\  & & belonging to this variety: 0.8393) & \\ \hline \multirow{3}{*}{2} & & variety of E & \\  & & (the probability of the sample & variety of C \\  & & belonging to this variety: 0.9999) & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Incorrect classification of original images for the CNN trained with original images. As a result, the proposed method gave the recognized fruit varieties together with their certainty factors (\(CF\)s). Because the classification model was performed based on two CNNs with different weights and many different fruit objects, it can be assumed that the approach was relatively objective, and the certainty factors can be reliable factors validating the correctness of the classification result. Consequently, the maximal value of \(CF\) (\(CF_{max}\)) may indicate the result of classification (i.e., a fruit variety with \(CF_{max}\) can be the correct class). In a situation where \(CF_{max}\) equals one, the given classification result can be treated as certain (it was in 875 cases out of 926 all - 94.49%). In 97.94% of cases, \(CF_{max}\) exceeded 0.7501, then the variety of fruit with \(CF_{max}\) was the correct variety. Only two misclassifications were detected for varieties with \(CF_{max}\in\{0.6700,\ 0.7501\}\) (Table 6). Therefore, in the large majority of cases (99.78%), the fruit variety with \(CF_{max}\) was the correct variety. All results of correct and incorrect classifications together with the values of the maximal value of \(CF\) are presented in Table 7. The actual classification related to predicted varieties of apples is shown in Table 8. \begin{table}
\begin{tabular}{c c c} \hline \hline
**No.** & **Image** & **Result Obtained** & **Correct Result** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Incorrect classification based on the \(CF_{max}\) value in the proposed method. Figure 2: The number of testing data related to the number of classifications for one photo  
According to the model results, it was possible to identify the limit value of _CF_ (\(CF_{limit}\)) for which variety of fruit with \(CF_{max}\leq CF_{limit}\) can be treated as an ambiguous classification. In the analyzed case, \(CF_{limit}\) can be equal to 0.7501. We had 19 original images for which the results of classification had \(CF_{max}\leq 0.7501\), including five original images with \(CF_{max}=0.5001\) (ROIs were not detected). Thus, the analyzed classification cases can be divided into three types as follows:  
* an unambiguous classification (where \(CF_{max}>0.7501\), 97.95% of cases)
* an ambiguous classification (where \(CF_{max}\leq 0.7501\) and classification based on the original image and at least one ROI image, 1.51% of cases)
* an uncertain classification (where \(CF_{max}=0.5001\) and classification based only on the original image, 0.54% of cases). To illustrate the above situations in detail, Figures 3-5 display examples of apple variety classification using the proposed method.