# Sensory Perception Systems and Machine Learning Methods for Pesticide Detection in Fruits
## 3 Results
### Classification of Pesticides in Fruits with Statistical Methods  
The accuracies of the methods evaluated with the data acquired through the two devices are found in Table 4, where it can be seen that the E-nose was able to predict the data behavior of different fruits from the linear discrimination classifier, regarding the classification methods, as the classification of plum obtained a value of 95.2%, followed by the apple with 90.5% success rate, where this value is repeated for the rest of the methods evaluated. The information above confirms the PCA and LDA results of Figures 3A,C and 4A,C. Furthermore, it was possible to classify the organic plum from the others by putting into practice the supervised methods in the same way for the organic apple with each of the pesticides studied (Amistar and Funlate). For the other fruits, 85.7% accuracy was obtained for cape gooseberry and 81% for strawberry with the E-nose. Moreover, a cross-validation method was applied to the measurements with a k-fold = 5 to validate these results, obtaining good accuracy through the different techniques. When analyzing the samples, the data may change due to the nature of the sample, even if it is from the same fruits and pesticides, taking into account the new variables added, such as sugars, minerals, or acids that are not volatile at ambient conditions. The classification percentages reach 95.2% concerning the results achieved by the classification methods, as seen in Table 4.  
Moreover, adding new variables improves the classification percentage by changing the order of the data; they can be adjusted to a model that improves the classification. With the E-tongue, the method that best predicts the behavior of the data is naive Bayes, since success percentages of 98% were obtained with cape gooseberry and 93.3% for plum, strawberry, and apple. Regarding cape gooseberry, if compared with Figures 4D and 6D, it was possible to determine that with the E-tongue, better classification and data discrimination were obtained. This explains that there is a satisfactory linear correlation applying the linear discrimination method, where it managed to achieve 80% classification in all fruits. The E-tongue appears more effective than the E-nose for classifying pesticide-treated fruits. This is evidenced by its greater accuracy and consistency across all classification methods and fruit types. The E-nose, although a useful system for agro-food applications, shows a more variable performance and, in this study, was less effective on fruits such as strawberry and cape gooseberry, which means that volatile compounds detected by the E-nose are more difficult to use for classification compared to compounds detected by the E-tongue. Table 5 depicts the metrics used to evaluate the performance of an E-nose in discriminating between organic fruits and fruits contaminated with various pesticides, based on \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Method**} & \multicolumn{8}{c}{**Accuracy**} \\ \cline{2-9}  & \multicolumn{4}{c}{**E-Nose**} & \multicolumn{4}{c}{**E-Tongue**} \\ \hline  & **Plum** & **Strawberry** & **Apple** & **Cape Gooseberry** & **Plum** & **Strawberry** & **Apple** & **Cape Gooseberry** \\ \hline Decision trees & 76.2\% & 52.4\% & 90.5\% & 65.7\% & 86.7\% & 86.7\% & 83.3\% & 96\% \\ \hline Linear discrimination & 95.2\% & 81\% & 90.5\% & 85.7\% & 90\% & 93.3\% & 93.3\% & 94\% \\ \hline Naive Bayes & 66.7\% & 47.6\% & 90.5\% & 62.9\% & 93.3\% & 93.3\% & 93.3\% & 98\% \\ \hline SVM (quadratic) & 85.7\% & 76.2\% & 90.5\% & 74.3\% & 93.3\% & 93.3\% & 90\% & 94\% \\ \hline SVM (cubic) & 81\% & 71.4\% & 90.5\% & 65.7\% & 93.3\% & 93.3\% & 86.7\% & 96\% \\ \hline K-NN (fine) & 85.7\% & 52.4\% & 90.5\% & 60\% & 90\% & 93.3\% & 86.7\% & 96\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Classification of fruits with pesticides through E-tongue and E-nose. the selection of the best classification model obtained in Table 4 and the confusion matrix.