MACHINE LEARNING APPROACH FOR CLASSIFICATION OF DALIUM GUINEENSE FRUITS

Having a mixture of similar items that needs to be separated for processing or for storage is a common challenge. Dalium guineense (DG) is a wild fruit with epicarp that could be broken accidentally or intentionally during harvest or in the course of processing. This research attempts to develop a model for classification of DG fruits into whole fruits and deshelled fruits each with fifteen physical characteristics (Length (l), width (w), thickness (t), geometric mean diameter, arithmetic mean diameter, specific mean diameter, equivalent mean diameter, surface area, aspect ratio, surface area, sphericity, unit mass, lw (product of length and width), lt (product of length and thickness) and wt (product of width and thickness)) using a machine learning approach. A 15-3-2 Neural Network (NN) architecture was used to develop the classification model. The deshelled fruits were all correctly classified while 95 of the whole fruits were correctly classified with 5 of the fruits misclassified. The result shows that the classification model was able to achieve an accuracy of 97.5%, sensitivity of 100%, and precision of 95.2%. Increasing the number of processing elements in the hidden processing layer of the NN contributed no positive effect on the performance of the model. This model is therefore suitable for classification purpose, leading to appropriate processing and handling of DG with high accuracy.


INTRODUCTION
Dalium guineense fruits are found in the wild and is yet to be domesticated.It is classified as a legume and belongs to the family Fabaceae (Besong et al., 2016).The whole fruits have been reported to be a good source of nutrients, micronutrients and minerals (Achoba et al., 1992;Adamu et al., 2015;Asoiro et al., n.d.;Ofosu et al., 2013;Okudu et al., 2017) and found to have antioxidant properties relevant in the treatment/management of chronic diseases (Bamikole et al., 2018).The fruit is structurally made of the seed coat (epicarp), the pulp (mesocarp) and the seed (endocarp).The mesocarp is the part eaten by humans however the endocarp and epicarp have been reported to have some nutrients and oil which can be put to use in the animal feed industry (Ofosu et al., 2013).Apart from directly eating its mesocarp, it has been used either whole or its fruit-fraction in the production of beverage drink (Adeola and Aworh, 2010), ingredient in candy making (Samakradhamrongthai and Jannu, 2021), used in the production of citric acid (Ajiboye and Sani, 2015), used for remediation (Onyia et al., 2019).
Classification of a class of mixed items is inevitable during processing.This may be done using the visual attributes like the size, colour, and shape.Manually classifying these items may not be efficient in terms of time with attendant high error.Researchers have used both hardware and/ or software to solve this problem.Some of the hard ware used include LED-induced fluorescence system (Dong et al., 2014), computer Vision system and some forms of visual/ imaging systems (Khojastehnazhand and Ramezani, 2020;Oliveira et al., 2016;Zhang et al., 2014), spectroscopy (Lee et al., 2020;Ozturk et al., 2023;Pholpho et al., 2011;Vega-Castellote et al., 2021) and some soft tools used are all machine learning tools such as artificial neural network (Zhang et al., 2014).
Artificial Neural Network (ANN), commonly called Neural Network (NN) has gained much popularity as a classification tool in broad spectrum of disciplines and was used to classify cause of death from verbal autopsy (Boulle et al., 2001).It is widely used in the areas of prediction and classification and applied in the food related researches (Dieulot and Skurtys, 2013), field of health and medicine for diagnosis and prediction of diseases (Chaudhary et al., 2013).Other advantages of NN are that they require no prior knowledge of data relationships, having self-learning capability, having self-tuning capability, applied to simple, complex, linear and non-linear problems, high tolerance for noisy data, as well as the ability to classify patterns on which they have not been trained (George, 2019).Multilayer Perceptron (MLP) neural network uses back-propagation to distribute the error terms to adjust each of the weights in the network.Backpropagation learns by iteratively processing a data set of training tuples, comparing the network's prediction for each tuple with the actual known value.For each training tuple, the weights are modified to minimize the mean-squared error between the network's prediction and the actual value.These modifications are done in backward direction from the output layer through each hidden layer down to the first hidden layer.The back-propagation algorithm is discussed in (Acharya et al., 2003;Han et al., 2012;Obot, 2007;Udoh, 2016;George, 2019).

MATERIALS AND METHOD Data set description
A set of high-quality whole DG fruits were purchased in a farmer's market in Uyo, Akwa Ibom State, Nigeria (5.0377 °N, 7.9128 °N) and were transported same day to the Food Engineering Laboratory of University of Uyo.They were air cleaned using compressed air to unstick any dirt that may have stock to the fruits.200 whole fruits were randomly selected and set aside for the experiment.50 % were manually deshelled to expose the mesocarp while the remaining 50 % were left whole.The following physical properties were measured from both groups respectively: Length (l), width (w), thickness (t), geometric mean diameter, arithmetic mean diameter, specific mean diameter, equivalent mean diameter, surface area, aspect ratio, surface area, sphericity, unit mass, lw (product of length and width), lt (product of length and thickness) and wt (product of width and thickness).This made up fifteen data set in all.The physical properties used were all measured as published previously by (Kılıçkan and Güner, 2008).

Neural Network Design
The neural network was designed with a 15-3-2 architecture where 15 represents the fifteen nodes at the input layer, 3 represents three processing elements at the hidden processing layer and 2 represents the two outputs at the output layer as shown in Fig. 1.The input layer was composed of the values from a data set rows, which constituted inputs to the next layer of neurons, the hidden layer.The final layer was the output layer, where there was one node for each class.In the training phase, the class label for each is known, and the output nodes are assigned "1" for correct values and "0" for the other.The network's calculated values for the output nodes are compared to the correct values, and the error term is calculated for each node.The error terms were then used to adjust the weights in the hidden layer so that, in subsequent pass through the network, the output values would be closer to the correct values.The input nodes xi were just to get the input values, multiplies by the connection weights linking each input layer to the hidden layer nodes, wij, and find the sum.The weight adjustment is given as: where   () = the connection weight from node i in one layer at time t,   = either an input or the output of the hidden node i,   = an error term for j,  = the learning rate,  is momentum (0<  <1).If j = an output node, the error term is given as in Equation 2: where   is the desired output of node  and   is the actual output.If node j is hidden node, the error term was computed as in Equation 3: The values at the hidden layer was given in Equation 4.
where f is the activation function,  is the number of hidden layer nodes,  is the number of input variables and   is the bias term.Back-propagation was performed at the output layer where it learns by iteratively comparing the network's prediction (computed) for each record with the actual known value (desired).For each training record, the weights were modified to minimize the mean-squared error between the network's computed value and the desired value.The modifications were done in backward direction from the output layer through each hidden layer down to the first hidden layer and the process was repeated until an acceptable low error is attained.In this case, the network is able to learn the data patterns (Udoh, 2016).

Classification Model Evaluation
Confusion matrix provides a veritable tool for calculating the various classification model metrics for evaluation of the model performance.The metrics include accuracy, sensitivity, precision, specificity, F1 score, false positive rate (FPR), and true positive rate (TPR) (Vujovic, 2021).

RESULTS AND DISCUSSION
The NN experiment was carried out three times with varying amount of data for training, cross-validation and testing and results presented on Table 1.The physical characteristics of the fruits that aided the classification included the Length (l), width (w), thickness (t), geometric mean diameter, arithmetic mean diameter, specific mean diameter, equivalent mean diameter, surface area, aspect ratio, surface area, sphericity, unit mass, lw (product of length and width), lt (product of length and thickness) and wt (product of width and thickness).These characteristics were measured for both the whole fruits (100 in number) and the deshelled fruits (100 in number) and they were then used as input to the model.
Similar experiments were carried out but with varying number of Processing Elements (PEs) at the hidden layer.
With PEs set at 4, 8 and 10, the classification results were the same as those where the PEs was 3.With 3, 4, 8 and 10 PEs at the hidden layer, it was observed that the network output is the same.It was therefore instructive to adopt the NN architecture with 3 PEs as there was no need to go for higher PEs to increase the network load which caused it to spend much time in the learning process.The network is able to most accurately classify the deshelled fruits at 100% for each of the three sets of experiments whereas for whole fruits, the classification is not so accurate.This is because there are some unmeasured and unaccounted properties of the whole fruits that cause the network to not properly learn the patterns supplied at the inputs for whole fruits.Thus, based on the experiments conducted, all the 100 samples of the deshelled fruits were classified correctly and 95 out of the 100 samples of the whole fruits were core correctly classified while 5 samples were misclassified.The confusion matrix for the classification was obtained as shown in Fig. 2. Confusion matrix is a table that summarizes the performance of a classification model.Parameters of the matrix are the True Positive (TP), False Negative (FN), False Positive (FP), and True Negative (TN).Some classification evaluation metrics presented in Table 2 show the performance of the classification model.It shows the model achieved an accuracy of 97.5%, sensitivity of 100%, and precision of 95.24%, among others.

Fig. 2: Confusion Matrix
Accuracy of 97.5% means that more than 97 out of 100 deshelled and whole fruits samples were correctly classified while less than 3 samples were misclassified.Sensitivity value of 100% means that all the samples out of 100 were correctly classified as deshelled while there was no misclassification.Specificity of 95.0% indicates that 95 out of 100 samples of whole fruits were classified correctly while 5 samples were classified wrongly.Precision of 95.24% means that on the average, more than 95 out of 100 samples were correctly classified as deshelled while less than 5 were wrongly classified.F1 score of 97.6% measures how well both deshelled and whole fruits were correctly classified.
Comparatively, classification accuracy of the current work outperforms that of Zhang et al. (2014) as shown in Table 2 for classification of fruits.Visualization of the actual and predicted class for whole fruits and deshelled fruits are shown in Fig. 3

Fig. 1 :
Fig. 1: The Neural Network Architecture false positive and false negative are predicted.Specificity (  + ) measures how well the model predicts negative classes.True Positive (TP) rate is the percentage of times a classifier correctly predicts desired outcomes, while True Negative (TN) rate refers to how frequent a classifier Fig. 3: Actual and Predicted Class for Whole fruits