## 4 The Proposed Scheme: Architecture and Components
### The COVID-19 Layer
#### 4.3.1 COVID-19 Social Distancing Monitoring  
\(E_{PS}\) monitors whether the persons (citizens), represented as \(P_{c}\), are following the social distancing norms or violating them. To assist them, we consider that \(k\)\(E_{UAV}\) forms a swarm network, represented as \(\{U_{1},U_{2},\ldots,U_{k}\}\). The UAV operations are controlled by \(E_{PS}\), where a single UAV might be administered by more than one \(E_{PS}\). We consider that in any given region \(R\), there are \(v\)\(P_{c}\) who have aggregated, with the trivial condition \(v>1\). \(E_{UAV}\) records their movements by capturing video sequences (frames) and applies fast detection AI algorithms such as Faster region-based convolutional neural network (F-RCNN), single-shot detector (SSD), and YOLOv3 algorithms [43]. We consider two persons \(P_{c1}\) and \(P_{c2}\) located at \(d\) distance apart. The role of the \(E_{UAV}\) is to monitor whether people are following the guidelines (social distancing) regarding the COVID-19 outbreak (public health emergency) issued by the World Health Organization (WHO) [8]. As per the WHO regulations, a distance of \(\approx\)2 m should be followed, which is represented as follows. \[D(P_{c1},P_{c2})\geq 2m \tag{1}\]  
Social distancing is a key measure that restricts the outspread of COVID-19 [8]. In algorithms such as F-RCNN and YOLO, there is a bounding box \(B\) with coordinates \((w,y,a,b)\), where \(w\) and \(y\) represent the top-left coordinates, and \(a\) and \(b\) are the width and height of the box. A ground truth \(T_{g}\) is considered for distance prediction. The distance \(D(P_{c1},P_{c2})\) is computed on the Euclidean metric, which considers the \(B\) coordinates as follows. \[D(P_{c1},P_{c2})=\sqrt{(X_{j}-X_{i})^{2}+(Y_{j}-Y_{i})^{2}} \tag{2}\]  
where \((X_{i},Y_{i})\) and \((X_{j},Y_{j})\) are the centroid measure of bounding boxes \(B_{1}\) and \(B_{2}\), which correspond to users \(c1\) and \(c2\). In the case where the distance \(D(B_{1},B_{2})\) is \(\leq\) 2 m, an alarm is raised and \(E_{MC}\) is notified of the condition. In such cases, \(E_{HC}\) registers the users for COVID-19 checkups at the nearest centers, and if the persons are found COVID-19 positive, registers them to the positive database and follows the quarantine rules. Algorithm 1 presents the schematics of the social distancing algorithm. We consider that \(k\) UAVs capture the real-time video feeds \(\{f_{1},f_{2},\ldots,f_{k}\}\) and number the frame sequences \(Seq_{f}\) into frame buffer \(F\). Lines 1-4 present the conditions. Once frames are numbered, we consider that for each captured frame, we form the bounding box through algorithms YOLOv3 or SSD and capture the box \(B\) coordinates. Next, we consider that for all person pairs (\(P_{c_{q}}\), \(P_{c_{i}}\)) captured through \(B\), the coordinates are noted and denoted as \(M_{q}\) and \(M_{q}\). If \(B\) coordinates are the same, it signifies two cases--(1) two persons are standing nearby, or (2) the algorithm has captured only one person's location. We iterate the frame sequences, and if the sequences are the same, then we continue to the next frame, else, we compute the euclidean distance \(D\). Lines 5-13 present these conditions. Next, if \(D<2\) m, then it is considered a social distancing violation, and the information is sent to \(E_{MC}\) for proper action. We also flag the critical flag as 1 to indicate the event. Lines 14-22 present the condition. ```
0: Registration information \(R(P_{c})\), UAV swarm network \(\{U_{1},U_{2},\ldots,U_{k}\}\). 0: Critical 3 FF Boolean flags \(\{f_{1},f_{2},f_{3}\}\), where \(f_{1}\) is the flag for social distancing violation and \(f_{2}\) is for sanitization.