# DeepSOCIAL: Social Distancing Monitoring and Infection Risk Assessment in COVID-19 Pandemic
## 4 Model Training and Experimental Results
### Model Training  
Four common multi-object annotated datasets were investigated including PASCAL VOC [55], Microsoft COCO [54], Image Net ILSVRC [106], and Google Open Images Datasets V6+ [107] which included 16 Million ground-truth bounding boxes in 600 categories. The dataset was a collection of 19,957 classes and the major part of the dataset was suitable for human detection and identification. The dataset was annotated using the bounding-box labels on each image along with the corresponding coordinates of each label.  
Figure 8 represents the sorted rank of object classes with the number of bounding boxes for each class in each dataset. In Google Open Images dataset (GOI) the class \"Person\" shows the 4 th rank, with nearly \(10^{6}\) annotated bounding boxes; richer than other three investigated datasets. In addition to the class person, we also adopted four more classes of \"Man\", \"Woman\", \"Boy\", and \"Girl\" from the GOI dataset for the \"human detection\" training purpose. This made a total number of 3,762,615 samples that we used from training, including 257,253 samples from the COCO dataset and 3,505,362 samples from the GOI dataset.  
We also considered the category of human body parts such as the legs as we believe this allows the detector to learn a more general concept of a human being, particularly in occluded situations or in case of partial visibility e.g., at the borders of the input image where the full-body of the individuals can not be perceived.  
Figure 9 shows examples of annotated images from the Open Images Dataset. The figure illustrates the diversity of the annotated people including large and small bounding boxes, in far and near distances to the camera image plane, people occlusion, as well as variations in shades and lighting conditions.  
In order to train the developed model, we considered a transfer learning approach by using pre-trained models on Microsoft COCO dataset [54] followed by fine-tuning and optimisation of our YOLO-based model.  
We also used Stochastic Gradient Descent (SGD) with _warm restarts_[108] to change the learning rate during the training process. This helped to jump out of local minima in the solution space and save the training time. The method initially considered a large value of the learning rate, then slowed down the learning speed halfway, and eventually reduced the learning rate for each batch, with a tiny downward slope. We decreased the learning rate using a cosine annealing function for each batch as follows:  
\[\eta_{t}^{i}=\eta_{min}^{i}+\frac{1}{2}(\eta_{max}^{i}-\eta_{min}^{i})(1+\cos (\frac{T_{cur}}{T_{i}}\pi)) \tag{19}\]  
where \(\eta_{t}\) is the current learning rate in the \(i\)th run, \(\eta_{min}\) and \(\eta_{max}\) are the minimum and maximum target learning rates. \(T_{cur}\) is the number of epochs executed since the last restart, and \(T_{i}\) is the number of epochs performed since the restart of the SGD.  
Figure 8: The number of annotated boxes per class in four common datasets. The horizontal axis is represented in logarithmic scale for better readability.  
Figure 9: Examples of annotated images in Open Images dataset.