# Cascaded Machine-Learning Technique for Debris Classification in Floor-Cleaning Robot Application
## 4 Methodology
### MobileNet V2 for Feature Extraction  
MobileNet v2 is a lightweight feature extractor that can be run in real time on low-power embedded systems. A significant change over standard CNN architectures is the use of depthwise convolution layers. These layers have a lesser computation cost compared to standard convolution  
Figure 2: Proposed Scheme: Cascaded CNN and SVM technique.  
layers. The depthwise separable convolution layers work on the principle of factorization. The standard convolution layers are factorized into two layers: a depthwise convolution layer and a pointwise convolution layer. This combination drastically reduces the computational complexities of the traditional convolution layers. Inverted residual layers are also used. This layer is based on the structure of convolution layers in the ResNet architecture i.e., residual learning which uses'shortcuts'. These improve the accuracy of the depthwise convolution layer while not having a large overhead. Bottleneck layers that reduce the size of input are used as well. These reduce the computation time drastically. An upper bound is applied on the ReLU layer, which serves to limit the overall complexity. Structure of the standard convolution layers used in MobileNetv2 is shown in Figure 3.  
Since the location of debris is also required, a bounding box predictor is used in place of the fully connected layers present in the feature extractor.  
SSD for Bounding Box Prediction  
Bounding box predictors output the bounding box coordinates and type of class along with the confidence level of classification. These coordinates can be translated into real-world coordinates to help the floor-cleaning robot avoid larger spillage debris. SSD is used in this paper due to its low computation cost, thereby allowing it to be deployed in real-world systems such as small floor-cleaning robots. It classifies the debris into solids and liquids spillage.  
SSD uses a CNN architecture to predict a set of bounding boxes over the region where a particular class is detected. These bounding boxes have a fixed size i.e., their sizes are selected from a set of predefined values. This modification helps to reduce the overall computation cost of these boxes. Although the boxes may not perfectly enclose the spill, the error is usually negligible. Since the boxes are of fixed sizes, the network employs multi-scale feature maps, which help to recognize objects of different scales. The network predicts a score along with the box coordinates, which indicates its confidence in the given prediction.  
Since bounding boxes have both location and class type are parameters, the loss cannot be directly computed. A special measure must be used which is a combination of these parameters. The overall loss in the prediction of bounding boxes is given in Equation (5).  
\[L=\frac{1}{N}(L_{conf}+\alpha L_{loc}) \tag{5}\]  
where N is the number of boxes predicted and \(\alpha\) is a weight parameter. \(L_{conf}\) is the SoftMax loss obtained from classification. \(L_{loc}\) is the \(L_{1}\) error obtained from location estimation of each box.