# Introduction n 31 Dec 2019, a number of pneumonia cases of unspecified aetiology in Wuhan, was notified to the WHO China Country Office. But, the influenza identified as COVID-19 quickly spread to many countries and on 11 March 2020, the WHO declared the outbreak a global pandemic [1]. Influenza outbreaks present a possible threat to humans because of their ability to rapidly adapt and impact people who are immunologically weaker. Readiness for pandemic flu is therefore a key step in response to these outbreaks [2]. In this regard, responding to the current COVID-19 pandemic and planning for possible pandemics needs critical preparation when there is no vaccine supply is to apply social distancing, quarantine measures along with rapid delivery of medical supplies such as personal protective equipment, anti-virus treatments, etc. Some of the measures used in the past as in the case of Spanish flu of 1918 or the recent, H1N1 pandemic of 2009 was to wearing masks, maintaining personal hygiene, social distancing, contact tracing and isolation of infected individuals helped in containing the spread of the influenza to a larger extent. Thus social Author ? ? ?: MIT -Chennai. e-mail: neela_pari@yahoo.com influenza outbreaks in a region. Moreover, according a recent study [3], assessed that one-time measures would not be adequate to reduce the occurrence of COVID-19, with the current critical care facilities of United States. According to the study it is indicated that these measures may be required till 2022. Especially in countries that lacks adequate public health and testing resources, "social distancing" or "physical distancing" measure helps in flattening the transmission curve, thus aiding in reduction of burden of the overwhelmed critical care units. Therefore, an one-time or single duration social distancing measure does not suffice to avoid intensive care resources from being overrun by the COVID-19 epidemic, as it retains enough of the population to be affected by the rebound in transmission, after the end of this pandemic cycle [4]. It is estimated that the lower bound of the economic benefit of social distancing measure in United States is approximately $8 trillion, which is greater than a third of its GDP. Moreover, the non-monetized benefits of social distancing include, quality treatment for non-COVID19 patients, short lock-down periods, buying time for developing a vaccine and strengthening the health sector resources [5]. Therefore, it is necessary to encourage appropriate social distancing. The proposed system has two methods for monitoring social distancing and alerting the smart phone users. The first method was developed using smart phone camera which will get the feed and processed with on-device deep learning algorithm deployed in the mobile to predict the social distancing. The implementation and result of this surveillance method are discussed in below sections. The second method measures the social distance between two smart phones using Bluetooth Low Energy technique. When the user scan for nearby devices, the Received Signal Strength Indicator (RSSI) value is received during the scan callback. The distance between the other device can be calculated using the received RSSI value, the formula and algorithm used for distance calculation is discussed in below sections. If the user violate social distancing, the app is designed to alert the users by a beep sound and displaying alert message. The experiment were conducted on various places such as College entrance, Office premises, Government office, Cafeteria ans so on. 85% of accuracy is obtained on detecting the real time social distance by these two methods. The rest of the paper is organised as follows: Section 2 explains the background and literature survey of pedestrian prediction, calculate distance between two objects in the 2D image and Bluetooth techniques. And Section 3 explains the proposed system of monitoring app used to predict the social distancing and various algorithm used for the prediction. Section 4 explains implementation and results for the developed application. Finally in Section 5, summarizes the research conclusion and applicable feature work. # II. # Related Work In this section, three types of techniques are reviewed which is used in the proposed system: (1) Pedestrian Prediction Method, (2) Distance Calculation by Image Processing Method, (3) Bluetooth Distance Estimation Method. # a) Pedestrian Prediction Method Various methods has been developed by various authors for pedestrian detection in both 2D and 3D image space. Jianqi Zhong et al. [6] developed pedestrian motion detection in 3D image since the human motion depends on 3D space. The authors developed twin deep neural network based on pose estimation. In [7], multi-task deep learning with no action recognition is used to estimate the time for pedestrian road crossing. This detection system is developed to avoid road accidents based on movement of people who crossing the roads. Quintero et al. [8] proposed Gaussian dynamic models and Activity recognition for detection pedestrian in order to avoid road side accidents. The proposed method is developed from multiple features of pedestrian activity such as: walking, stopping, starting and standing. Rehder et al. [9] studied pedestrian prediction using Deep Neural network which can be used in traffic management and to avoid collision in autonomous vehicle. The authors trained the model using monolithic neural network via reverse reinforcement learning. Choi et al. [10] developed Deep learning based pedestrian trajectory considering the location relationship between the people. The displacement between neighbouring frames for every pedestrian in the sequential video frames are calculated. The motion information are encoded using LSTM (Low Short Term Memory) and uses MLP (Multilayer perceptron) to map the location. # b) Distance Calculation by Image Processing Method The distance between two object in 2D image can be calculated by different image processing techniques and mathematical formulations like Euclidean and Manhattan distance formula. Johny Singh at al [11] developed distance calculation of a object in 3D image using Stereo camera. The distance of the object is calculated using Euclidean distance between centroid of the bounding box and the camera and they obtained the result with 2.08 average error. JongBae [12] proposed a method to detect pedestrian and distance estimation using smart phone based thermal cam-era which can run in low light environment. The detector was created using multi-stage cascade learning and distance is estimated by calculating the position of the pedestrian in the 2D thermal image. On their experiment they obtained 91% accuracy in detecting pedestrian and 85% in distance estimation. Chong Sun et al. [13] in their paper discussed distance estimation between two persons using latent variables by minimizing a distance function. They developed latent metric learning method using effective metric matrix. # c) Bluetooth Distance Estimation Method Bluetooth low Energy (BLE) is a low cost, lost power portable technology which is growing exponentially. Lam and She [14] in their paper discussed on the distance estimation of the moving object using BLE. They Received Signal Strength Indicator (RSSI) from the noisy environment and overcome by using Kalman Filter (KF) to smooth the RSSI measurement. The filtered RSSI value is trained by Support vector machine using non-linear kernel function to estimate the distance. The mobile users received limited rate for distance estimation and there is some delay on calculating the distance. Yoon et al. [15] used BLE and ultrasound signal to calculate the distance between the device. The received RSSI value are not accurate due to various environment factors. For estimating distance, the authors introduced propagation constants estimation based on Time difference of arrival between BLE and ultrasound signals. The estimated error increases as the distance increases in real time, they obtained distance estimation with 10cm average error distance. Yuan and Chang [16] proposed Indoor positioning system based on RSSI value from the BLE beacon. The authors used weighted multi point algorithm with cellular network assistance for calculating real time distance and achieved error rate of 0.8%. # III. # Social Distance Monitoring For measuring social distance two methods are proposed, one is using mobile camera which can process the video frames and calculate the distance. Next method uses smart phone Bluetooth low energy BLE (Bluetooth Low Energy) hardware and calculates distance by its signal strength. Explained step by step process of both the methods in the below section. # a) Camera surveillance Method The smart phone camera captures the video frames to track the social distancing. Image rendered frame by frame are passed into the loop of the image detection algorithm. Image processing are done for noise removal and passed to the pedestrian trained model. The outcome image will draw a rectangular bounding boxes when any persons are identified in the image. The classified image with person are feed to calculate distance using euclidean algorithm. The whole working process of the system is explained in the Fig. 1. ii. Calculating Distance Once the pedestrian is predicted from the image, the distance between the two persons are calculated by using Euclidean algorithm. The euclidean distance between two point measure the length of segment connecting two points. Euclidean distance Euclidean distance between any two points p 1 = {x 1 ; x 2 ; :::; x n } and p 2 = {y 1 ; y 2 ; :::; y n } is given as follows: Manhattan distance Manhattan distance between any two points p 1 = {x 1 ; x 2 ; :::; x n } and p 2 = {y 1 ; y 2 ; :::; y n } is given as follows: if realTimeDistance _ thresold then 10: displayAlertMessage() 11: ED(p 1 , p 2 ) = (x 1 ? y 1 ) 2 + (x 2 ? y 2 ) 2 + ... + (x n ? y n ) 2 ED(p 1 , p 2 ) = n j=1 (x j ? y j ) 2 M D(p 1 , p 2 ) = |x 1 ? y 1 | + |x 2 ? y 2 | + ... + |x n ? y n | M D(p 1 , p 2 ) = end if 12: end for For instance if there is 6 persons bounding boxes in one frame as given in the Fig. 4. The first person is compared with remaining all five persons distance. If the first person maintains safe distance then the point is added in safe list. Followed with second person will be compared with other four persons excluding the first one, if the second person doesn't maintains social distance with any other points then it is added to unsafe list. Similarly the other iterations of persons are followed with remaining persons in the list. With the help of this technique, at the end, the number of safe and unsafe list of data is stored in the data structure. The above algorithm is processed in every frames of the camera feed which is received after processing from object detection algorithm. Redraws the bounding boxes with predicted persons with safe and unsafe with different color in indication. The Algorithm 2 explains the execution for measuring social distancing using euclidean distance. With every frame received from camera feed with rectangular frames, the midpoint of every rectangle is calculated and the two points are passed to measure the distance. # iii. Percentage Calculation Once the distance of every bounding boxes are calculated, the list of safe and unsafe distance are obtained. To alert the pedestrians who doesn't follow social distancing, the alert window mentioning the percentage of people following safe distance and color indication of zone whether the region is in safe zone (Green Indication), area which is likely to safe and danger which means average group will fall under this category (Orange Indication) and finally unsafe zone where most of the people doesn't maintain social distance (Red Indication) are displayed in order to create alertness and awareness to the users. Algorithm 3 explains the logic for percentage calculation based on the safe and unsafe distance determined. The app user are alerted by displaying various color zone whether the peoples are maintaining safe or unsafe distance. # b) Bluetooth Module Another method of calculating the distance between the two persons using smart phone is Bluetooth Low Energy (BLE) technique. When two persons installed this app with the help of BLE support 4.0 the approximate distance can be calculated. RSSI (Received Signal Strength Indicator) is the strength of the beacon signal received at smart phone. The RSSI value ranges from -26 (few inches) to -100 (40-50 meters) distance. Along with RSSI there is another factor called Measured power used for the calculation. The formula for the distance calculation using BLE is given below. IV. # Implementation and Results # a) Experimental Setup For Pedestrian prediction and distance calculation experiments were conducted in Windows 10 machine (2.60 GHz, i7 processor, 32 GB RAM and 1GB Graphics Card) for training the model and exporting the model in smart phone. Following tools like tensorflow, opencv and other supporting libraries are installed for training the model. Once the model is trained and exported to tensor flow lite model with the help of use Android Studio developed the android application. After developing the app it is tested in Samsung S7 Android device with Oreo supported. The results of the camera surveillance method are discussed in below sections. For the Bluetooth distance calculation, developed and installed the app in different smart phones with BLE supported. When two smart phones are bring to closer distance alert message and sound will be popped in both the phones. # b) Training and Evaluating Model The proposed system is trained and evaluated on INRIA Person data set and Penn-Fudan datasets which contains more real world human image data sets. This data set provides pedestrian bounding boxes for pedestrian detection and pedestrian attributes for estimating the pedestrian behavior. In order to test the detection performance, various experiments are conducted in different places. In the first detection experiment, the performances of the algorithm are investigated using the classical approach without action recognition on the INRIA data set. The Table 1 and 2 shows the accuracy, precision and F1-Score obtained during training the model. The Fig. 5 shows the accuracy and loss on training and validation of the model. # c) Pedestrian Prediction Result The Tensor Flow lite model is exported for Android mobile app development, with the help of Tensor Flow SDK and API the object detection are predicted in live camera feed. Once the persons are identified with their bounding boxes it is passed to distance calculation algorithm module. The Fig. 6 displays the persons predicted from the trained model Distance = 10 ((M easured P ower -RSSI)/(10 * N )) (1) along with the distance calculation determining whether they are safe or risk position. The experiment was conducted with group of people with using the model, it detects the pedestrian with 91% of accuracy. The limitation of using mobile phone camera is that it is capable of only covering small distance. # Fig. 6: Pedestrian Result d) Distance Calculation Result For distance calculation in image, the center point of every bounding boxes from the object detection result are obtained and distance between the two mid points are calculated. The distance are in pixels value, for real time determination of distance value, the pixels value are processed with some image processing technique. The whole pixel distance is divided with average human width in order to get exact distance in real values considering different zoom levels of camera. Once the distance are calculated a line is drawn between the two persons for indication, the green color indicated the two persons maintains the safe distance and red color indicates the two persons are at risk. The Fig. 7 shows the mobile app with persons who maintains safe and unsafe distance. This experiment was conducted in public places, where people usually roams at high density and identified the social distance prediction is about 85% accurate as real values. For distance calculation using Bluetooth low energy, developed another mobile app feature which has option to turn on social distance monitoring. When user turns on, The scanning for BLE will be triggered where the device discovery for other bluetooth device will take place. Once the new device is identified the device details like UUID, RSSI value are identified in the device discovery callback. With the help of RSSI signal strength, the distance are calculated using Eq. ( 1). The App is installed on two devices and alerts are displayed on both phones when they are placed within a distance of less than one meter. The Fig. 8 shows the popup between two android devices which are less than one meter. The implemented mobile application estimates the distance calculation of the proposed system on two android phones keeping with measured distance say 1, 2 and 3 meters. The estimated value has the error value between 10 to 20 cm on average comparing to its real time value. The Table 3 shows the results obtained from various phone which returns the approximate value of real time distance. The different values of RSSI are collected and its average is calculated to determine the final distance. The values may vary device to device based on the hardware of Bluetooth signal receiver. From the Table 3, it is inferred that the average distance estimation error decreases as the distance increases. The Fig. 9 shows the comparative graph of actual distance and estimated distance in various mobile distance. # Conclusion and Future Work The paper presents two methods of monitoring social distancing for smart phone users. In camera surveillance method, pedestrian detection is implemented using deep learning algorithm and distance between two persons using euclidean formula. In Bluetooth distance calculation, calculated the real time distance by receiving its signal strength between two android devices. It is cost effective approach since this system is implemented in mobile app, people don't want to spend cost for other infrastructure for surveillance and monitoring. Developed this model in Android mobile, as a future work it will be extended in iOS environment as well for supporting iPhone users. As discussed, the smart phone camera are capable of covering only small distance, the first approach can be leveraged in all public surveillance camera for social distance monitoring. 1![Fig. 1: System Flow i. Predicting Pedestrian The pedestrian prediction training model is trained by Tensorflow environment. The following steps are required in order to train the model. ? Gathering Images and Labeling data ? TFRecords Creation ? Training and Exporting model For gathering the data set, the images are downloaded from INRIA Person data set and Penn-Fudan database which different image formats are converted to JPEG format. Maintained 80% of images to training and 20% to test testing folder. The tensor flow needs more number of images in various background to train the model with good precision and accuracy. After downloading the data set, the labelling of all the images are done by creating a rectangle box on the target object using the tool called labelImg.The TF Record file is tensor flow format used for storing a sequence of binary records. After labelling](image-2.png "Fig. 1 :") 2![Fig. 2: Single Shot Detection Model](image-3.png "Fig. 2 :") 3![Fig. 3: Pedestrian Detection From the frame image of pedestrian detection, the list of bounding boxes that covers every persons are retrieved. With the help of bounding boxes the center point of each is calculated using the top, left, right and bottom pixel values of bounding boxes. Then](image-4.png "Fig. 3 :") ![n j=1 |x i ? y i | Monitoring Social Distancing by Smart Phone App in the Effect of COVID-19 the center point of each bounding boxes are passed to distance calculation algorithm to calculate the distance between them. From the algorithm two lists of persons who maintain safe social distance and list of persons who are at unsafe distance are derived.](image-5.png "") 4![Fig. 4: Processing Bounding Boxes in Frame Algorithm 2 Social Distance Measurement Algorithm Input: An array of point (x,y) such that x is the xcoordinate of the point and y is the u-coordinate of the point Output: Array of points with unsafe distance 1: if P.length <2 then 2: return nil 3: end if 4: for iterator1 = [P.length : 1] do 5: for iterator2 = [1:?, iterator1] do 6: D = Compute Euclidean Distance (P[iterator1], P[iterator2]) / Avg Person Width 7: if (D ? safe Distance) then 8: add Unsafe Pair(P[iterator1]; P[iterator2]) 9: end if 10: end for 11: end for 12: return unsafe Pair Algorithm 3 Percentage and Zone Calculation Input: An array of safe and unsafe Points Output: Percentage and Zone of Social Distancing 1: if unSafeList.length ? 0 then 2: return nil 3: end if 4: percentage = calculatePercent(safeList, unSafeList) 5: if percentage in safeThersold then 6: color = Green 7: else if percentage in averageThersold then 8: color = Orange 9: else if percentage in dangerThersold then 10: color = Red 11: end if](image-6.png "Fig. 4 :") 5![Fig. 5: Training and Validation Evaluation](image-7.png "Fig. 5 :") ![Number of samples correctly distinguished as malicious Number of samples correctly distinguished as benign Number of samples erroneously distinguished as malicious Number of samples erroneously distinguished as benign (TP+TN)/(TP+TN+FP+FN) TP/(TP+FP) TP/(TP+FN) 2*((precision*recall)/ (precision +recall))](image-8.png "") 7![Fig. 7: Distance Calculation Result](image-9.png "Fig. 7 :") 8![Fig. 8: BLE Distance violation alert in two Android devices](image-10.png "Fig. 8 :") 2AccuracyPrecisionRecallF1-Score91.1092.5083.0685.3 3Mobile Model1m2m3m1Samsung S71.181.982.842OnePlus 51.042.103.023Honor Lite 91.52.193.214Moto E Plus0.981.862.785Samsung S101.062.053.10 ( ) C © 2020 Global Journals © 2020 Global Journals ## Acknowledgments The author would like to thank Tourenathan-G5organisation for downloading the transfer learning model from their Github link. The authors would also like to extend our thanks to Madras Institute of Technology campus, Chennai and their staff for their help and support in making this work possible during this pandemic situation. * Scientific and ethical basis for social-distancing interventions against covid-19 JALewnard NCLo The Lancet. Infectious diseases 2020 * The first in-fluenza pandemic in the new millennium: lessons learned hitherto for current control efforts and overall pandemic preparedness CFranco-Paredes PCarrasco JI SPreciado Journal of immune based therapies and vaccines 7 1 2009 * Social distancing strategies for curbing the covid-19 epidemic SMKissler CTedijanto MLipsitch YGrad 2020 medRxiv * Isolation and contact tracing can tip the scale to containment of covid-19 in populations with social distancing MKretzschmar GRozhnova MVan Boven Available at SSRN 3562458 2020 * Does social distancing matter? MGreenstone VNigam 2020-26, 2020 University of Chicago, Becker Friedman Institute for Economics Work-ing Paper * Pedestrian motion trajectory prediction with stereo-based 3d deep pose estimation and trajec-tory learning JZhong HSun WCao ZHe IEEE access 8 2020 * Multi-task deep learning for pedestrian detection, action recognition and time to cross prediction DOPop ARogozan CChatelain FNashashibi ABen-Srhair IEEE Access 7 2019