# Small-Scale Face Detection Based on Improved R-FCN
## 2 Related Works
Selection Method of Candidate Boxes and Anchor Setting of Region-Based Fully Convolutional Networks (R-FCN)  
In this section, we change the non-maximum suppression (NMS) of R-FCN to SoftNMS and reset the anchor. R-FCN is a universal object detector, which has some differences from the face detector. First, the general objects have large scales and different shapes, while most of the faces are rectangular and the ratio of length to width is fixed. Second, face detection is affected by various interference factors, such as illumination, expression, occlusion, and other factors; however, these factors only slightly affect the detection of general objects. Therefore, R-FCN should be modified to make the framework suitable for small-scale face detection. Original R-FCN uses NMS to filter candidate boxes, but the threshold setting in NMS affects the precision of detection. If the threshold is too low, then the true positive samples will be suppressed. If the threshold is too high, then the false positive samples will increase. In face detection in a low-constraint environment, face occlusion is most common, and NMS will cause missed detection. In this study, SoftNMS [25] is used to improve the performance of face detection under occlusion conditions. SoftNMS is defined as follows:  
\[s_{i}=\left\{ \begin{array}{ll}s_{i}(1-IoU(M,t_{i})),&IoU(M,t_{i})\geq N_{t }\\ s_{i},&IoU(M,t_{i})<N_{t}\end{array} \right. \tag{1}\]  
\(s_{i}\) denotes the score of the \(i\)-th candidate box. \(M\) and \(t_{i}\) are the coordinates of the candidate box with the highest score and the coordinates of \(i\)-th candidate box. \(IoU(. )\) represents the ratio of the intersection of the candidate box \(i\) with \(M\) to the union of candidate box \(i\) with \(M\). \(N_{t}\) is a preset threshold. Formula (1) shows that SoftNMS will attenuate the scores of candidate boxes when IoU of candidate boxes with \(M\) is greater than the threshold \(N_{t}\). Therefore, candidate boxes that are far from \(M\) will be unaffected, and candidate boxes that are close to \(M\) will be punished. However, NMS directly sets the score of the candidate boxes to 0 when IoU of the candidate box with \(M\) is greater than the threshold \(N_{t}\). Compared with NMS, SoftNMS retains candidate boxes that are easy to delete by mistake. In original R-FCN, the base size of the anchor is 16 according to the general object detection. The scale of anchor is set to (8, 16, 32) according to the distribution of the scales on PASCAL VOC dataset. The aspect ratio is (0.5,1,2); thus, 1 pixel corresponds to 9 anchors. However, many small-scale faces are involved in face detection; we modify the anchor according to the specific properties of the faces to prevent the small-scale faces from being missed due to the improper setting of anchor. Considering that most faces are rectangles with a length greater than or equal to width, we set the aspect ratio of anchor as (1, 1.3, 1.5). [PERSON] et al. [19] emphasized that 80% of the face scales on the Wider Face training set are between 16 and 406 pixels. Accordingly, we set the base size of anchor as 8 and scale as (1, 2, 4, 8, 16, 32, 64). The modified R-FCN has 21 anchors, which can cover most of the face samples on Wider Face.