# Cascaded Machine-Learning Technique for Debris Classification in Floor-Cleaning Robot Application
## 4 Methodology
### Training Phase  
Aver vision system and Kinect v2 RGB-D sensor are used in real-world scenarios to capture images for training the network. Two viewpoints were taken into consideration: top view and robot view. About 2000 training images are captured at dynamic floor backgrounds with various classes of food debris, including solid food waste, semi-solids, and large liquid spillage. Besides, to improve the CNN learning rate and prevent over-fitting, data expansion is applied to the captured images. Data Expansion increases the number of images in the dataset by using simple geometrical transformations such as rotation, scaling and flipping. Furthermore, to reduce the computing load in the training stage, the captured images are resized into \(640\times 480\) pixels. The dataset is balanced across the two classes. There are around 900 images for each class. These images contain one or more  
Figure 3: MobileNet v2 Architecture.  
debris of a single type (solid or liquid). The remaining images consist of mixed debris which contain both solid and liquid debris in the same image. The number of debris per image on an average is 2. These images are labeled manually for training the network by drawing bounding boxes over the detected debris.  
The grid search algorithm determines some of the hyperparameters in the CNN and the hyperparameter \(\lambda\) for the SVM. It is using different combinations of possible values for finding the optimal hyperparameters. The combination that results in the highest accuracy is chosen. For CNN, the initial learning rate is set to 0.002. The decay factor for RMS prop is set to 0.9. A batch size of 32 is used and the number of epochs for training is 10,000. The other hyperparameters of the model are inherited from a pre-trained model (trained on MS COCO dataset) [35]. Similarly, the hyperparameter \(\lambda\) for SVM is obtained as 1.0.  
A batch size of 20 is used while training the CNN. The loss is optimized through the Root Mean Squared Propagation (RMS Prop) [38] algorithm with a decay factor of 0.9. RMS prop uses gradient \(g_{t}\), weight \(w_{t}^{rms}\) at any time \(t\), exponential average \(v_{t}\) to estimate the weight at time \(t+1\). Equation (8) is used to update the weights in the network. Here, \(\eta\) is the initial learning rate, set to 0.002. \(\beta\) is a hyperparameter tuned by the network. \(\epsilon\) is a parameter introduced to prevent divide by zero errors.  
\[v_{t}=\beta v_{t-1}+(1-\beta)g_{t}^{2} \tag{6}\]  
\[\Delta w^{rms}=\frac{-\eta}{\sqrt{v_{t}+\epsilon}}\times g_{t} \tag{7}\]  
\[w_{t+1}^{rms}=w_{t}^{rms}+\Delta w^{rms} \tag{8}\]  
The network is implemented in the TensorFlow framework on Ubuntu 16.04. A system with the following hardware configuration is used for training and testing: Intel Xeon E5-1600 V4 CPU with 64 GB RAM and an NVIDIA Quadro P4000 GPU with 12 GB Video memory.  
The computation of performance metrics involves the use of K-fold cross-validation. In this technique, the dataset is divided into K subsets with K\(-1\) subsets used for training and the remaining subset for evaluating the performance. This process is repeated K times to get the mean accuracy and other performance metrics of the model. K-fold cross-validation is done to ensure that the figures reported are accurate and not biased towards a particular dataset split. This work uses 10-fold cross-validation. The images shown are obtained from the model with the highest accuracy.