Blockchain and AI-Empowered Social Distancing Scheme to Combat COVID-19 Situations

The COVID-19 pandemic situation has proved to be disastrous for humanity throughout the world. However, during this period, people must take precautions for safety purposes. One of the essential steps towards eliminating or reducing the effect of COVID-19 is maintaining social distancing while in public places. Some people are neglecting the social distancing norms while on the move. Still, no surveillance system exists, which monitors the people’s movement for social distancing and securely & efficiently shares the information with the concerned administration department. There also exists no penalty system which forces the people to ensure social distancing. Motivated from the aforementioned facts, in this paper, we present a blockchain and artificial intelligence (AI)-envisioned scheme for monitoring social distancing to combat COVID-19 situations. The proposed scheme uses fast region-based convolutional neural networks (RCNN) and you only look once (YOLO) models for the object (i.e., human) detection through the live video feed captured from the static CCTV cameras as well as lens-equipped drones. Further, the efficient euclidean distance calculation is embedded for calculating the distance between two humans. Blockchain technology ensures the secure and trusted exchange of information between the entities at the physical layer and the administration departments. Blockchain wallets are also used to pay the fine when people do not follow social distance norms. The performance of the proposed scheme is evaluated based on three broad parameters such as (i) human detection and violation identification, (ii) blockchain simulation and analysis, and (iii) network performance comparison. The parameters considered for (i) is confidence score, for (ii) are scalability, hash rate, and simulation interface, and for (iii) are network bandwidth, throughput, packet loss rate, and network latency. By analyzing all the parameters mentioned above, we observe the proposed scheme outperforms the traditional approaches.


FIGURE 2.
Country-wise number of COVID-19 cases and deaths [4]. silent transmitters of viruses and may affect people who come in their contact or vicinity. This contributes to an increasing number of affected people. The tremendous outburst of coronavirus has triggered various studies to understand the virus and develop solutions and vaccines to mitigate COVID-19 spread and its devastating effects [6].
The existing literature on COVID-19 provides a brief idea of the COVID-19 situations as well as predictions. But, it does not address the aspects of the proposed scheme, i.e., integration of AI, blockchain (a distributed ledger technology that offers security, privacy, and immutability via hash cryptography, and trust via digital smart contracts to the data), unmanned aerial vehicles (UAVs), Internet of things (IoT), and 5G-enabled communication channel can be leveraged strategically in such situation [7]. UAVs are flying aerial devices comprised of cameras and sensors under the control of ground stations. UAVs helps to monitor the people whether they are following the norms of social distancing from the aerial view.
Nguyen et al. [8] presented a detailed survey on enabling wireless technologies to combat social distancing during the pandemic situation. Pham et al. [9] presented a survey on state-of-the-art AI and big data solutions to tackle the pandemic. Yang et al. [10] given a CNN-based visionary critical density detection for social distance evaluating in COVID-19 situations. Chamola et al. [11] conducted a comprehensive review of COVID-19 and the scope of IoT, AI, drones, blockchain, and 5G in managing the impact of COVID-19. They have systematically reviewed the pandemic, its impact, and how emerging technologies can be utilized in its management. Tuli et al. [12] presented a prediction model for the prediction of the rise and fall of the number of cases. Wang et al. [13] utilized BERT to study the evolution of public sentiments on social media with the spread of COVID-19. Rustam et al. [14] utilized linear regression (LR), least absolute shrinkage and selection operator (LASSO), support vector machine (SVM), and exponential smoothing (ES) to forecast the number of new cases, deaths, and the number of recoveries in next ten days. Pathak et al. [15] proposed a deep bidirectional long short term memory network to classify COVID-19, infected patients, using chest computed tomography (CT) images.
Later, Wang et al. [16] utilized a transfer learning-based model to classify chest X-rays into normal, COVID-19, and pneumonia classes. Alsaeedy and Chong [17] proposed an idea to detect regions of high human density, which may be at risk of spreading COVID-19 using the existing cellular network. Waheed et al. [18] proposed CovidGAN -a model to generate synthetic chest X-ray using a generative adversarial network (GAN) to enhance the performance of COVID-19 detection models. As per the literature, a few works have been published that considers the UAV and other camera-based social distance monitoring using blockchain technology. So, motivated by all the previous work carried out by various researchers, we propose a blockchain-based intelligent scheme for identifying locations where social distance violation is done using surveillance cameras and drones. Our scheme leverages AI techniques to detect the humans and social distance violations and blockchain for secure data transfer among all the stakeholders.

A. MOTIVATION
The existing approaches to combat COVID-19 situations are more focused on the prediction of infection spread, classification of normal and COVID infected patients, monitor the performance of COVID-19 detection models, and density detection for measuring social distancing. But, the exchange of live feed/images (captured via UAV/static IoT-based cameras) to the concerning authority to penalize the violators of social distancing norms in COVID-19 pandemic that helps to resist the spread of COVID-19 infections. Thus, this motivates us to propose such system that automates this process with high security, i.e., using blockchain.

B. CONTRIBUTIONS
Following are the contributions of this paper.
• An amalgamation of blockchain technology and AI technique is proposed to secure manage social distancing in the COVID-19 pandemic.
• We propose a secure and automated smart contractbased fine-tuned algorithm to combat COVID-19 situations.
• Finally, we investigate the performance of the proposed scheme by comparing the ROC-AUC curve, hash rates of Ethereum with the other blockchains, the number of VOLUME 9, 2021 blocks mined, network throughput, latency, and bandwidth with 4G communication infrastructure.

C. ORGANIZATION
Rest of the paper is organized as follows. Section II discusses the problem formulation. Section III discusses the proposed blockchain and AI-based scheme for managing the social distancing to combat COVID-19 situations. Section IV discusses the performance evaluation of the proposed scheme and finally, Section V concludes the paper.

II. PROBLEM FORMULATION
For problem formulation, we consider a real-time scenario where the people are moving out and do not follow the social distancing norms in the COVID-19 pandemic [10]. If not follows, a fixed penalty will be charged in the form of digital currency via blockchain technology. The mathematical formulation of this scenario is as follows. It involves the following entity set E = {E c , E uav , E a }, where E c is set containing citizens of any smart city {c1, c2, . . . , cn}, the set of UAVs to E uav = {uav 1 , uav 2 , . . . , uav m }, and E a = {a 1 , a 2 , . . . , a o } represents the set of administrators who control the UAVs. These entities are related to each other subject to the following constraints.
where, f1 shows one-to-many function between UAV and the administrators, i.e., a singly UAV can be controlled by multiple administrators (as shown in f2). f3 shows the function that both E uav and E a jointly monitor the citizens E c . Let n citizens are walking around a specific location where n > 1, then E a deploys the E uav to keep tracking the E c whether they are following the social distance needed or not subject to the constraint.
While functioning, E uav does E c detection using the faster detection algorithms of RCNN and YOLO models. Over the years, there has been the development of a number of object detection models with increasing accuracy. Some of them are RCNN [19], faster RCNN [20], single shot detector (SSD) [21], and YOLO [22]. They have been tested on popular datasets such as PASCAL-VOC [23] and MS-COCO [24]. But they differ in terms of accuracy and speed due to factors like input size, backbone architecture, feature extraction network, depth, etc.

1) FASTER RCNN
Faster RCNN is derived from RCNN and fast RCNN [20]. It uses region proposal network (RPN) to share the complete image's convolutional features with a detection network, generating almost cost-free region proposals. This is different from other networks, which utilize region proposal algorithms to find object locations. The feature maps are fed into both the modules. RPN is used to detect the locations, which contain the object, and the corresponding locations and bounding boxes are passed to fast RCNN for object classification. Eq. 6 shows the loss function of Faster RCNN, as follows [25].
where t i is the predicted bounded box is the height and width of bounding box, v is the ground-truth bounding box, r * i is the predicted class label, and r i is the actual class. N cls is mini-batch size, N reg is number of anchor locations and δ is weight balancing parameter.
YOLO is another approach for object detection [26]. It formulates the object detection problem as a regression problem. It consists of a neural network that predicts bounding boxes and calculates class probabilities from an image in one evaluation. There are three versions of YOLO, namely, v1, v2, and v3. YOLO v1 architecture is inspired by the GoogLeNet model utilized for image classification with one major difference of using reduction layers followed by convolutional layers, instead of inception modules. YOLO v2 uses Darknet-19 as a base for object classification. YOLO v2 was a significant improvement over v1 in terms of MAP, FPS, and object classification scores. YOLO v3 used Darknet-53 as a backbone and performed classification using independent logistic classifiers. There is a further improvement over v2 and it is better in classifying small objects. Eq. 7 shows the loss function of YOLO, as follows [22], [27].
where 1 obj i denotes if object appears in i th cell and 1 obj ij denotes the j th bounding box predictor for i th cell is responsible for that prediction, S is the grid size in which the image is divided, B is the number of bounding boxes predicted in each grid cell, (p, q) represent the box center, (a, b) is the height and width of bounding box, D is the conditional class probability and δ co and δ noobj are parameters to prevent model instability.
The model generates a bounding box around the E c . After the successful detection, the distance between pair of E c is calculated using Euclidean distance D in the Euclidean plane calculated as follows.
where X i , Y i and X j , Y j are the coordinates of centroid coordinates of the bounding box of E i c and E j c respectively. Here, the E a decides the threshold value for minimum social distance to be maintained (i.e., > 1.8288meters) as follows.
where, no-alarm situation is when the calculate euclidean distance D is greater than the specified T value. Otherwise, UAVs or nearby IoT devices generates an alarm. This model's objective is to ensure the people are following the government/WHO specified social distancing norms or not by monitoring it via static cameras or UAV cameras. If the people are violating the same, then inform the nearby administrative departments and impose a penalty that will be automatically deducted from their ethereum wallets. This becomes a step forward in restricting the spread of novel coronavirus.

III. THE PROPOSED SCHEME
FIGURE 3 shows the proposed blockchain and AI fusion architecture to monitor social distancing in the COVID-19 pandemic. AI detects humans in the open space and draws a virtual bounded box around them. Then, it calculates the distance between them and compared it against the threshold value (decided by government/administration bodies, i.e., 1.8288 meters). In case of any violation in social distancing norms, an alarm will be generated automatically and sent the coordinates of the concerned person to the administrative departments. Then, the administrative department has to initiate appropriate action against them. The proposed scheme is logically divided into four layers, such as (i) physical layer, (ii) AI layer, (iii) blockchain layer, and (iv) administration layer. The description of each layer is as follows.

A. PHYSICAL LAYER
This layer comprises physical entities (connected to the blockchain network) such as surveillance (static) cameras and drone-mounted cameras at low altitude platforms [28]. The static cameras capture the live feed of the surroundings and send them to the AI layer for further processing [29]. It is assumed in the proposed system that the static cameras are mounted at height, such that the plane captured by the cameras is orthogonal to the persons or citizens. This ensures that the people captured appear nearly as a point, making the distance calculation between them accurate. FIGURE 4 shows the live-feed capturing situation via the orthogonal axis. Monitoring social distancing through the static cameras video feeds does not always capture all possible positions and locations and the citizens are on the move [30]. So, capturing a live feed from the orthogonal axis is quite difficult. We have also deployed UAVs (embedded with high definition cameras) for live video feed capturing to overcome this issue. The video feeds captured from the static as well as UAV-embedded dynamic cameras are forwarded to the blockchain layer for storage and AI layer for further analysis, such as human detection and distance violation identification.

B. AI LAYER
The live video feed is received by the AI layer from the surveillance cameras and UAVs and processes them to identify humans/citizens who have violated the social distance regulations. It works in two phases such as human detection and distance calculation phases. The human detection phase utilizes deep learning models to detect people in an image and mark a bounding box around them. For this, a video is loaded into the memory and segmented into different frames, which are then fed into the model for detection. The models used here are Faster-RCNN and YOLO, pre-trained on the COCO dataset for object (human) detection. The dataset contains 80 different categories of objects [31]. The model is fed with frames and calculates the score for each object. If the score is above the threshold value, which means the object belongs to the human class, then the object is tagged as an identified person and a bounding box is drawn around it. Algorithm 1 shows the step-by-step procedure for human detection and social distancing violation identification. After the identification, the frames are passed to the distance calculation phase. In this phase, the distance between the identified bounded boxes is calculated (from the centroid position). The surveillance cameras are recording feeds from a height and are placed such that the person is orthogonal to the plane of capturing. The distance can be easily calculated by calculating the euclidean distance between the centroid pixels of the bounding boxes. If the calculated distance between the two centroids is less than a fixed threshold, then the person is marked as violating social distancing norms or is considered safe. Since the persons are orthogonal to the capturing plane of the surveillance device, the error in distance calculation will be low as compared to other configurations.

C. BLOCKCHAIN LAYER
In the blockchain layer, all the other layers of crucial information get stored immutably. Any stakeholder in the system can connect to the blockchain through the ETH-Client of Ethereum [32]. Then, it can access the functionalities of the smart contract. The SC for the proposed system is developed using Solidity language [33]. The SC is needed for the registration to the framework. During the registration, several legal details such as government authorized ID, know your customer (KYC), and bank statement verification are done. All citizens' personal details are stored in the InterPlanetary file system (IPFS) distributed file storage protocol. The hash key returned on successful uploading is mapped along with the citizen over the blockchain. Hence, embedding IPFS helps to serve an off-chain data storage solution as storing the data over the blockchain is costly. Further, IPFS also solves the bandwidth issues as the data is offloaded over the decentralized web and linked to the blockchain. After submission of details, the local police department examines and verifies results ← model.detect(V i ) bounding box 6: for box x in results do 7: for box y in results do 8: if box x = box y then 9: continue 10: end if 11: D ← euclidean_distance(box x , box y ) 12: if D > T then 13: trigger_alarm() 14: end if 15: end for 16: end for 17: end for 18: end procedure the details and with the successful registration, the private and public keys for wallets are provided to the end smart citizen [34].
As shown in the Algorithm 2, after registration in the framework, the deep learning models supervise all the public places and detect an alarm where the social distance is less than legit suggested by the government under COVID-19. During this constant procedure, whenever the social distancing is not maintained, the prediction model shows it to the police that supervises the system [8]. Then, the proof, such as distance measurement and the photo is saved, and a fine is initiated against the concern, which is posted by the police after verification. The citizen on getting this fine notification gets his status detained until he pays the fine. Also, suppose the citizen fails to pay the penalty within a specific time period. In that case, the citizen will get an exponential increment in the fine and legal punishments. But, if the citizen pays the fine through secured payment through blockchain-enabled cryptosystem like ETH, then his status is again rolled back to valid. All these transactions are stored in an immutable distributed ledger of Ethereum to ensure transparency in the system. Moreover, the smart contract maintains the constraints to be followed by both police and citizens and make sure that no one can perform any unauthorized activity, which further serves as a partially decentralized governance mechanism.

D. ADMINISTRATION LAYER
This layer acts on the information about the violations received through the blockchain network. It consists of physical entities such as police stations, healthcare, and municipal offices. These entities maintain and enforce that the correct guidelines are met at the violation locations. They will also send announcements through the UAVs to maintain social distancing at the places from where the violation was detected [35]. This layer is also responsible for controlling the UAVs, which captures the live video feed of humans on the move.

IV. PERFORMANCE EVALUATION
This section evaluates the performance of the proposed scheme and also discusses the results of various AI models. The models have been run for human detection and violation identification with different confidence score parameters of 0.1, 0.3, 0.5, 0.7. Similarly, for smart contract execution, the Ethereum 1.0 public blockchain platform, the solidity v. 0.5.3 compiler is used and Remix IDE is used for testing and debugging purposes.

A. HUMAN DETECTION AND VIOLATION IDENTIFICATION
The first and foremost step after receiving the live video feed is to detect people in it. This is done through object detection and isolation. The models used for this purpose are Faster RCNN and YOLO. All these models have been trained on the COCO dataset for object detection and isolation. The models have been fine-tuned to detect humans in an image. To simulate the working, images have been scraped from the internet.
The first step is to feed the input video, frame-by-frame, to the model for object detection. The model will detect the people in the image and create bounding boxes or masks around identified people. After marking the bounding boxes distance between centroids of individual bounding boxes is calculated. If the distance is below the set threshold value, then both bounding boxes will be marked as violating social if E ∈ E p && SD < D req then 17: E ←Emit Error(''Stakeholder not Authorised !'') 33: end if 34: end procedure distance regulations. The threshold distance is the minimum distance (in pixels) that should be there between centroids of bounding boxes. For simulation purposes, the calculation of threshold distance has been done through physical experimentation by placing a camera at the height of 20 feet and placing two people at a safe distance (1.8288 meters). The threshold has come out to be 75 pixels.
The models were run on hundred images to identify if violations are observed in the image. On average, Faster RCNN took 1.18123s, whereas YOLO took 1.058312s for detection. VOLUME 9, 2021    Faster-RCNN). An AUC score of 1.0 shows a perfect classifier. A score of 0.73 and 0.7 indicates that models are able to identify violations correctly to a great extent. From the images and roc-auc curve, it can be concluded that both models successfully detect people in images and identify the violations of social distancing as defined by the local administrative bodies such as municipal corporations, etc. Both models have missed a few people, made incorrect identification, and classified a few people as one person. As the confidence score increases, the misses and incorrect identification increase. Faster-RCNN takes comparatively more time than YOLO in detection. This could be attributed to the architecture of both. Faster-RCNN works in two phases, first it uses region proposal networks to locate objects and then uses an object detection network to classify detected regions. YOLO on the other hand predicts bounding boxes and classifies the regions together in one pass. However, the model performance largely depends on the environment and the models can be fine-tuned as per the environmental circumstances.

B. BLOCKCHAIN SIMULATION AND ANALYSIS 1) BLOCKCHAIN SCALABILITY
The scalability in blockchain can be defined as the total time needed to couple the transactions to a block and add it to the blockchain, along with an increase in the rate of transactions. FIGURE 8 shows the graph of scalability compared to the traditional blockchain frameworks. Here, the y-axis represents the transaction time in milliseconds with the number of blocks mined in the x-axis. The proposed system allows more number of transactions to be added to the IPFS and blockchain at the quantum of time [36]. Also, the IPFS reduces the storage burden on the blockchain by keeping all data and forward data hash to the blockchain (instead of original data) [37]. After visualizing the graph, it has been concluded that the proposed scheme using Ethereum blockchain outperforms the traditional approaches. This happened because Bitcoin is a traditional blockchain framework and lacks the technological uplifts present in Ethereum. Hence, it can be concluded that the proposed scheme with higher scalability becomes advantageous for smart city revolution.

2) MINING HASH RATE COMPARISON
Hash rate (also known as the hash power) is the pace at which a cryptocurrency mining device operates. In the blockchain, mining needs computational resources when it comes to public blockchain such as Ethereum. Hence, the mining hash correlates with the computation required for its consensus mechanism. FIGURE 9 compares the hash rate of the proposed scheme with Ethereum to other traditional frameworks such as Ethereum Classic and Blackcoin. Here, the y-axis represents the hash rate in Tera Hash per second along with the sample time period of 3 months shown in the x-axis. It has been observed that the proposed scheme outperforms   the traditional approaches with the maximum hash rate. Hence, overall decentralization in the network is maintained with a high hash rate along with improved security against attacks [38]. FIGURE 10 shows the different functionalities of the proposed scheme that are tested by deploying the developed solidity smart contracts into Remix IDE. The javascript virtual machine of send extension in Remix IDE is utilized to interface with these capacities. The usage of the scheme can be checked by the interface provided. Here, the payable capacities are encoded with red shading, viewable capacities with blue color, and others in orange shading.

C. NETWORK PERFORMANCE COMPARISON 1) NETWORK BANDWIDTH WITH IPFS
This section shows the bandwidth utilization comparison of IPFS protocol in contrast to Ethereum blockchain. Bandwidth  is measured as the amount of data that can be transferred from one point to another within a network in a specific amount of time. In the proposed scheme, the major data on the offchain is stored in distributed IPFS storage. Hence, most of the time, data is fetched and IPFS utilizes the bandwidth. FIGURE 11 shows the bandwidth utilized in kilo-bits per second with the passage of sample time for simulation. This data is the result of the IPFS simulation carried by running the IPFS node and testing the upload and download of data in the decentralized web. It can be clearly seen that the IPFS protocol uses less bandwidth than Ethereum nodes. Hence, this low bandwidth optimizes the overall performance of the network in the proposed scheme.

2) NETWORK THROUGHPUT
The network throughput examination is finished with other conventional frameworks. The throughput in networking estimates the number of information packets that showed up at the goal IP effectively. FIGURE 12 shows the examination of throughput in y-pivot with the expansion of information demands in the network. The graph depicts the correlation of the proposed scheme with 4G long term evaluation advanced (LTE-A), which guarantees a high remote versatile information rate of up to 300Mbps contingent upon the MIMO type, which far surpasses the throughput of the previous third-generation (3G) portable remote access innovation. In 5G-enabled tactile Internet (TI), DSS is a significant VOLUME 9, 2021  innovation since it gives both a simple method for transporters to ''turn on'' 5G administrations utilizing their current 4G frequencies and lets them join the two to improve throughput. It very well may be determined by the representation of the graphs that the proposed scheme with 5G outflanks conventional network frameworks. There are different variables influencing network throughput in a framework, for example, transmission medium, network thickness, dormancy, and packet loss. 5G's higher frequencies will empower a lot quicker examining rates, notwithstanding giving fundamentally better throughput. Also, the need to send edge processing to guarantee general throughput and low inactivity for ultra-solid, low inertness communications arrangements is a significant driver for 5G. Thus, because of these reasons, the network throughput execution of the proposed scheme outperforms the customary approaches.

3) PACKET LOSS RATE
The packet loss rate alludes to the portion of packets that the objective could not get, including packets dropped, packets lost in transmission, and packets got in the wrong organization. While getting to the Internet or any network, little units of information called packets are sent and gotten [40]. When at least one of these packets neglects to arrive at its expected goal, this is called packet loss. FIGURE 13 shows the examination of the packet loss rate with increment in synchronous medicinal services information traffic ascending for communication in the proposed scheme. The graph shows the examination with 4G with a data transfer capacity of 20 Mbps, a postpone variety somewhere in the range of 2 and 40 milliseconds and a packet loss rate of 0.1%. Thus, the proposed scheme has been observed to beat the customary approach with a standard packet loss likelihood of 10 5 to 10 7 . Consequently, this low rate of packet loss empowers powerful communication with less re-sending of information packets in the network of the proposed scheme.

4) NETWORK LATENCY
The network latency depicts the responsiveness of the overall proposed system in accordance with the data communication that takes place continuously during the data migration procedure from the real-time environment to the administrator's location via a blockchain network. FIGURE 14 shows the latency comparison of the existing COVID-19 mitigation or information systems with 4G with the proposed 5G-TI-based system. In this graph, the y-axis shows the latency in milliseconds (ms) with respect to the number of transactions executed/stored in the system. Through this visualization, it can be summarized that the proposed system outperforms all the other 4G-enabled existing schemes with minimal latency.

V. CONCLUSION
In this paper, we have proposed a scheme that leverages deep learning and blockchain technology for real-time monitoring of social distancing. The humans are detected using object detection models and a bounding box is drawn around them. Then, the pair-wise distance between each individual is calculated using the generated bounding boxes. Suppose the distance is less than the set accepted threshold value. In that case, the respective officials (from municipal corporations, etc.) are alerted of the violations through blockchain so that necessary steps can be carried out for enforcement. We experimented with state-of-the-art object detection models such as Faster RCNN and YOLO, and YOLO proved to be better in the experiment. However, the performance of the model depends a lot on the environment in which it is deployed and can be fine-tuned to achieve better performance results.
In the future, we will evaluate the performance of the proposed scheme by considering varying datasets and parameters. Also, we will explore the mitigation of privacy issues in the proposed system using private blockchain and federated learning techniques.