# DeepSOCIAL: Social Distancing Monitoring and Infection Risk Assessment in COVID-19 Pandemic
## 3 Methodology
### People Detection
#### 3.1.3 Neck Module  
Recently, some of the modern proposed models have placed some extra layers between the backbone and the head, called the neck, which is considered for feature collection from different stages of the backbone network.  
The neck section consists of several top-down and bottom-up paths to collect and combine parameters of the network in different layers, in order to provide a more accurate image features for the head section.  
Many CNN-based models use fully-connected layers for the classification part, and consequently, they can only accept fixed dimensions of images as input. This can lead to two types of issues: firstly, we cannot deal with low-resolution images and secondly, the detection of the small objects would be difficult. These are in contradiction with our objectives where we aim to have our model applicable in any surveillance cameras with any input image sizes and resolutions. In order to deal with the first issue we can refer to existing methodologies such as Fully Convolutional Networks (FCNs). Such models, including YOLO (in their recent versions) have no FC-layers and therefore can deal with images with different sizes. However, to cope with the second issue (i.e., dealing with small objects), we performed a pyramid technique to enhance the receptive field and extract different scales of the image from the backbone, and finally, performing a multi-scale detection in the head section.  
In DNNs, the bottom layers (i.e., the first few layers) extract localised pattern and texture information to gradual build up of the semantic information which is required in the top layers. However, during the feature extraction process, some parts of the local information that may be required for fine-tuning of the model, may be lost. In PANet [69] approach, the information flow of the bottom layers will be added to top layers to strengthen of localised information; therefore, better fine-tuning and prediction can be expected. In a recent research by [PERSON] et al. [53], it is shown that the concatenation operator performs better than addition operator to maintain the localised information and transferring them to the top layers.  
In order to further enhancement of the receptive fields and achieve better detection power on the small objects, we consider YOLO Feature Pyramid Network module (FPN) [74] module for multi-scale detections. The module extracts features in different scales from the backbone. Ref. [97] improved YOLOv3 with a Spatial Pyramid Pooling layer (SPP) [59] module instead of FPN, that leads to a 2.7% increase in the AP\({}_{50}\) on the MS COCO object detection. The improved SPP uses max-pooling operation instead of \"Bag of Words\" operation to address the issue of spatial dimensions and to deal with multi-scale detection in the head section. The method applies a \(k\times k\) max-pooling kernel, where \(k=\{1,5,9,13\}\), and stride equals to 1.  
In Section 4 we will examine the efficiency of this approach in improving the accuracy of our YOLOv4 based model. Figure 5 shows the multi-scale heads that we used in our network for object detection at different sizes.  
Experimenting various rational configurations for the neck module of our model, we use spatial pyramid pooling (SPP) and PAN as well as the Spatial Attention Module (SAM) [98] which together  
\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Backbone Model** & **Input Resolution** & **Number of Parameters** & **Speed (\(fps\))** \\ \hline CSPResNeXt50 & \(512\times 512\) & 20.6 M & 62 \\ CSPMarknet53 & \(512\times 512\) & 27.6 M & 66 \\ EfficientNet-B3 & \(512\times 512\) & 12.0 M & 26 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparisons of three backbone models in terms of number of parameters and speed (\(fps\)) using an RTX 2070 GPU.  
made one of the most effective, consistent and robust components to focus the model on optimising the parameters.