###### Abstract  
The ubiquitous existence of COVID-19 has required the management of congested areas such as workplaces. As a result, the use of a variety of inspiring tools to deal with the spread of COVID-19 has been required, including internet of things, artificial intelligence (AI), machine learning (ML), and geofencing technologies. In this work, an efficient approach based on the use of ML and geofencing technology is proposed to monitor and control the density of persons in workplaces during working hours. In particular, the workplace environment is divided into a number of geofences in which each person is associated with a set of geofences that make up their own cluster using a dynamic user-centric clustering scheme. Different metrics are used to generate a unique geofence digital signature (GDS) such as Wi-Fi basic service set identifier, Wi-Fi received signal strength indication, and magnetic field data, which can be collected using the person's smartphone. Then, these metrics are utilized by different ML techniques to generate the GDS for each indoor geofence and each building geofence as well as to detect whether the person is in their cluster. In addition, a Layered-Architecture Geofence Division method is considered to reduce the processing overhead at the person's smartphone. Our experimental results demonstrate that the proposed approach can perform well in a real workplace environment. The results show that the system accuracy is about 98.25% in indoor geofences and 76% in building geofences. d 2022 21 July 2022 21 July 2022 21 July 2022 222 2  
mitigate the spreading of the virus by facilitating the process of monitoring and realization of COVID-19 control measures. IoT can be used to provide identification of persons and to collect different types of data required for managing the COVID-19 control measures. Machine learning can be used in various applications that can help to deal with COVID-19. Furthermore, geofencing technology can be used to control and monitor persons moving in/out of virtual boundaries to enforce COVID-19 control measures. Researchers have applied machine learning techniques in different fields such as logistics [3; 4], tourism [5; 6], finance [7], and so on. In addition, machine learning and deep learning techniques can be adopted to provide effective solutions for the current problem of geofencing. In this approach, the workplace is divided into a set of geofences. Then, based on the nature and requirement of the work, the workplace environment will be clustered using the idea of a dynamic user-centric clustering [8]. Different wireless parameters and metrics play important roles as location signatures to apply such geofencing techniques, especially with applying machine learning with it. These metrics include the Wi-Fi basic service set identifier (BSSID) and the Wi-Fi received signal strength indication (RSSI) of the Wi-Fi access points (APs) and other smartphone sensors such as magnetometers and accelerometers. In the literature, many recent works have been conducted to monitor and detect violations of defined COVID-19 control measures using information technology advancements. In [9], the authors introduce the \"LakshmanRekha\" smartphone app for home quarantine based on continuous user biometric authentication (CUBA), where biometric camera data and the global positioning system (GPS) location are collected from the smartphone sensors. This app consists of two modules, the front-end apps that consist of two apps, namely the administration app and patient app, and the home quarantined management (HQM) back-end. The authors in [10] present an IoT-Q-Band solution that can be used to prevent the spread of COVID-19. In this solution, a lightweight bracelet is worn by a quarantined person and connected to a smartphone application through Bluetooth technology. The person is registered by their personal details and the GPS parameters of their location as well as defining the geofence of this person.