# Underwater Accompanying Robot Based on SSDLite Gesture Recognition
## 3 Framework and Methodology
### Underwater Human Tracking  
In order to realize the continuous tracking of underwater humans by UAR, we use a combination of a target detection network and a target tracking algorithm to continuously track specific targets in the image, so as to provide help for the next gesture recognition. Considering the limited memory space and computing power of embedded devices, we chose the SSDLite detection network with better speed and size to complete the detection work. The SSD (Single Shot MultiBox Detector) algorithm [34] is one of the most widely used algorithms in object detection, which adopts a deep neural network model of end-to-end single shot MultiBox real-time detection. It integrates the regression idea of YOLO [35]  
Figure 2: Estimation network structure. and the candidate box mechanism of Faster R-CNN [36]. The SSD algorithm greatly reduces the computation of neural networks and improves the running speed of algorithms by using the idea of regression. In addition, the SSD algorithm uses the local feature extraction method to obtain features at different positions, different aspect ratios and different sizes, which is more efficient than the YOLO's global feature extraction method for a particular location. The overall objective loss function of the network is the weighted sum of localization loss \(L_{\text{loc}}\) and confidence loss \(L_{\text{conf}}\). \[L(x,c,l,g)=\frac{1}{N}(L_{\text{conf}}\left(x,c\right)+\alpha L_{loc}(x,l,g)) \tag{3}\]  
where \(N\) is the number of matched default boxes and the \(L_{\text{loc}}\) is the Smooth L1 loss [36] between the parameters of predicted box \((l)\) and the ground truth box \((g)\). \(L_{\text{conf}}\) is the softmax loss on the multi-class confidences \((c)\) and the weight term \(\alpha\) is set to 1 through cross-validation. Based on SSD, SSDLite replaces all of the regular convolutions in the detection layer with separable convolutions (Depthwise followed by \(1\times 1\) projection) [37]. Compared with the conventional SSD model, SSD Lite has fewer parameters and less computational cost, so it can be better applied in embedded devices. For the real-time detection of mobile embedded networks, a network with good accuracy and real-time performance is needed as the backbone of SSDLite. The MobileNet [38] network is a lightweight CNN proposed by Google, which replaces ordinary convolution with Depthwise Separable Convolution to improve the accuracy and speed of detection while reducing the size of the model. MobileNetV3 [39], on the basis of preserving the Depthwise Separable Convolution of V1 and the Inverted Residuals Block of V2, introduces a lightweight attentional model based on the squeeze and excitation structure, by combining with the characteristics of the channel relationship to enhance the learning ability of the network. Meanwhile, the h-swish and h-sigmoid functions as shown in Equations (4) and (5) are used to replace the swish and sigmoid functions of the network, respectively. Thus, the computation of the network is further reduced and the model is made more suitable for the mobile embedded platform. \[h-\text{swish}(x)=x\frac{\text{ReLU}6(x+3)}{6} \tag{4}\]  
\[h-\text{sigmoid}(x)=\frac{\text{ReLU}6(x+3)}{6} \tag{5}\]  
Since the underwater tracking scenario requires more real-time performance, we discarded the neural network tracking algorithm with poor speed performance and choose the faster KCF algorithm as the underwater human tracking algorithm. The human body in the underwater frame is detected using the SSDLite, and the kernelized correlation filters (KCF) tracker is initialized using the detection result. In the subsequent tracking stage, the tracker is densely sampled with the target position in the previous frame of the video as the center, and all of the obtained samples are input to the trained ridge regression classifier. After the classification of the ridge regression classifier, the position of the target is obtained.