# Design of Machine Learning Solutions to Post-Harvest Classification of Vegetal Species
## 3 Experimental Evaluation
### Comparison
#### 3.2.1 Color Spaces  
After comparing five color spaces over 110 experiments, we observed the significance of the color space in image classification. In most comparisons between the CNN and SVM models, the RGB color space had lower accuracy scores than the other color spaces. For example, if we analyze cases E1 to E3 in Table 3, RGB scores approximately 10% less than the best performant color space for cases E1 and E3. In the case of segmented images, E2 achieved a score that was over 40% lower. However, RGB performed as well as the other \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Case** & **Train** & **Test** & \multicolumn{6}{c}{**Color Spaces**} & \multirow{2}{*}{**Model**} \\ \cline{5-9}
**Ex** & **DSx** & **DSx** & & **RGB** & **YCbCr** & **HSL** & **HLG** & **HSV** \\ \hline - & 1 & 1 & 90.9\% & - & - & - & - & \\ - & 2 & 2 & 95.4\% & - & - & - & - & ResNet-50+ \\ - & Mix & Mix & 92.9\% & - & - & - & - & - & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Evaluation of RGB color space with the ResNet-50+ model (mixed dataset, DS1, and DS2). \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Case** & **Train** & **Test** & \multirow{2}{*}{**BS**} & \multirow{2}{*}{**Reg**} & \multirow{2}{*}{**YbCr**} & \multirow{2}{*}{**HSL**} & \multirow{2}{*}{**HLG**} & \multirow{2}{*}{**HSV**} & \multirow{2}{*}{**Model**} \\
**Ex** & **DSx** & & & & & & & & & \\ \hline E1 & & & & & 86.6\% & 92.4\% & 93.1\% & 98.1\% & 96.5\% \\ E2 & 1 & 1 & & ✓ & 54.4\% & 97.8\% & 100.0\% & 95.0\% & 92.6\% \\ E3 & & & & ✓ & 89.1\% & 93.5\% & 97.8\% & 93.5\% & - \\ \hline E4 & & 2 & & & 98.0\% & 93.4\% & 97.4\% & 98.0\% & 95.0\% \\ E5 & & 2 & & & ✓ & 92.1\% & 96.0\% & 96.7\% & 96.2\% & 92.1\% \\ \hline E6 & & & & & 63.3\% & 63.3\% & 70.0\% & 67.9\% & 60.3\% \\ E7 & 1 & 2 & & ✓ & 67.0\% & 67.0\% & 70.0\% & 80.0\% & 62.8\% \\ \hline E8 & & & & & 57.0\% & 48.0\% & 52.5\% & 56.6\% & 49.4\% \\ E9 & & & & ✓ & 48.0\% & 48.0\% & 49.0\% & 48.9\% & 49.8\% \\ \hline E10 & 1 & 1 & & & 87.9\% & 87.8\% & 87.7\% & 86.7\% & 89.7\% \\ E11 & & & & ✓ & 89.4\% & 87.1\% & 91.1\% & 90.5\% & 90.1\% \\ \hline E12 & & 2 & & & 99.3\% & 96.7\% & 98.7\% & 98.0\% & 96.0\% \\ E13 & & 2 & & ✓ & 97.4\% & 96.0\% & 94.7\% & 91.4\% & 91.5\% \\ \hline E14 & & & & & 66.5\% & 66.5\% & 66.5\% & 64.1\% & 63.5\% \\ E15 & 1 & 2 & & ✓ & 63.3\% & 63.3\% & 70.1\% & 67.9\% & 71.9\% \\ \hline E16 & 2 & 1 & & & 48.0\% & 48.0\% & 48.0\% & 51.0\% & 48.0\% \\ E17 & & & & ✓ & 48.6\% & 48.1\% & 41.6\% & 48.8\% & 51.4\% \\ \hline E18 & & & Mix & & & 85.5\% & 92.1\% & 91.5\% & 89.8\% & 94.1\% \\ E19 & Mix & 1 & & & 95.4\% & 93.7\% & 97.5\% & 97.6\% & 97.6\% \\ E20 & & 2 & & & 78.4\% & 86.1\% & 84.6\% & 83.6\% & 80.5\% \\ \hline E21 & & & Mix & & ✓ & 88.7\% & 90.5\% & 90.0\% & 89.1\% & 90.1\% \\ E22 & Mix & 1 & & ✓ & 96.4\% & 96.6\% & 98.2\% & 96.7\% & 96.6\% \\ E23 & & 2 & & ✓ & 78.2\% & 72.4\% & 82.9\% & 86.4\% & 79.7\% \\ \hline Avg. for all cases & & & & 77.3\% & 79.3\% & 81.3\% & 81.6\% & 79.1\% \\ Avg. except for different DSs & & & & 87.8\% & 91.5\% & 93.5\% & 92.7\% & 91.6\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Experimental results (accuracy for each experimental settings). color spaces when DS2 was used as the training set in cases E4 and E5 and, in some cases, slightly better. The most effective color spaces for classifying okra were HSL and HLG. In cases E1-E7, E11, E14, E16, E19, E22, and E23, these two color spaces achieved the highest scores and approximately a 10% improvement in some cases compared with the standard RGB color space. Moreover, even in cases where HSL and HLG did not perform the best, the difference in accuracy between these color spaces and the best-performing color space was not significant. Thus, by comparing the color spaces of multiple algorithms and training datasets, we can confirm that color space transformation is highly beneficial for good image classification. HSL and the combination of HLG emphasize lightness and color intensity variations better than the other color spaces.