# Accelerated Inference of Face Detection under Edge-Cloud Collaboration
## 1 Introduction  
Face detection is widely used in today's industries, and faces have large visual errors in different backgrounds, which makes face detection more difficult. Scholars have proposed lots of models successively, such as PyramidBox [1], TinaFace [2], SRN [3], and so on. They achieved decent performance in accuracy. However, in edge devices with limited computing resources, such as mobile phones, Raspberry Pi, and other embedded devices with insufficient computing resources, when deploying large models, there will be problems such as high inference delay, excessive energy consumption, and memory overflow. In addition, in recent years, some scholars have made contributions to the application of face models [4] and facial feature data [5]. For example, [PERSON] et al. [4] proposed an MFCosface to solve the problem of low facial recognition rate during the epidemic. On the one hand, the appearance of model compression [6; 2; 7; 8; 9; 10; 2] alleviates this problem to a certain extent. Model pruning, as an effective means of model compression, can ensure the accuracy of the model and reduce the FLOPs of the model. [PERSON] et al. [11] obtained a sparse weight matrix by retraining the network by setting the weights below the threshold to 0 and repeating this process. However, this approach is mostly used in CNN image classifiers and is rarely used in other fields. On the other hand, edge-cloud collaborative inference, as a new neural network inference paradigm, can effectively reduce the neural network inference delay. It divides a large neural network into two parts: one part is deployed on edge devices, and the other part, which usually has a larger scale and higher computational load, is deployed on cloud servers. [PERSON] [12] used this paradigm to divide the middle layer of the neural network model to reduce the communication delay, thereby speeding up the end-to-end reasoning speed. Inspired by these two aspects, this paper makes full use of the characteristics of both to perform two-step acceleration processing on the deep neural network model to reduce the end-to-end inference delay ofthe model. The overall framework of the algorithm is shown in Figure 1. It mainly includes three phases: cloud training phase, optimization phase, and collaborative inference phase. Cloud training phase. At the beginning of the training phase, a target detection model with strong generalization ability is obtained through the training dataset. After that, all layers of the model are decoupled and redundantly analyzed, and the convolutional and deconvolutional layers are pruned through L\({}_{1}\) regularization sorting and predefined thresholds. The pruning operation may inevitably destroy the generalization ability of the original model, then use the global fine-tuning strategy to restore the accuracy of the model, so that a simplified model with less computation and less loss of accuracy can be obtained. Optimization phase. The optimizer selects the best split point of the model under the current dynamic bandwidth to maximize the performance of the model and speed up the delay of end-to-end inference. It mainly relies on three inputs: (1) the dynamic bandwidth and delayed demand; (2) the compressed model through cloud training, which requires much fewer computing resources than the original model; (3) the relational mapping table is the pre-split point and the inference latency between different devices by testing in the actual operation. In addition, the specific implementation of the optimizer algorithm is detailed in Section 3. Collaborative inference phase. The model is divided according to the best split point. One part that requires fewer computing resources is deployed on the edge, and the other part requires a large amount of computing to be deployed on the cloud server. The remainder of the paper is structured as follows: Section 2 provides background and related technical information. Section 3 provides a more detailed design of our algorithm.