key: cord-0659192-q9amx2sh authors: Abdellatif, Alaa Awad; Samara, Lutfi; Mohamed, Amr; Erbad, Aiman; Chiasserini, Carla Fabiana; Guizani, Mohsen; O'Connor, Mark Dennis; Laughton, James title: I-Health: Leveraging Edge Computing and Blockchain for Epidemic Management date: 2020-12-18 journal: nan DOI: nan sha: 0df3735bb3015b8b25fcaead32b5842da46db021 doc_id: 659192 cord_uid: q9amx2sh Epidemic situations typically demand intensive data collection and management from different locations/entities within a strict time constraint. Such demand can be fulfilled by leveraging the intensive and easy deployment of the Internet of Things (IoT) devices. The management and containment of such situations also rely on cross-organizational and national collaboration. Thus, this paper proposes an Intelligent-Health (I-Health) system that aims to aggregate diverse e-health entities in a unique national healthcare system by enabling swift, secure exchange and storage of medical data. In particular, we design an automated patients monitoring scheme, at the edge, which enables the prompt discovery, remote monitoring, and fast emergency response for critical medical events, such as emerging epidemics. Furthermore, we develop a blockchain optimization model that aims to optimize medical data sharing between different health entities to provide effective and secure health services. Finally, we show the effectiveness of our system, in adapting to different critical events, while highlighting the benefits of the proposed I-Health system. Advances in e-health and Internet of Things (IoT) technologies can play an integral, crucial, and evolving role in providing swift responses to outbreaks and health crises. In light of the recent pandemic, the development of smart, efficient and secure health system for the purpose of managing and stopping the spread of such crises becomes a worldwide interest. A pivotal contribution towards the development of intelligent health system can be achieved by automating most of the healthcare functions to provide efficient healthcare services. Emerging technologies, such as Artificial Intelligence (AI), Edge Computing, and Blockchain, can turn this vision into reality. Such technologies can transform the traditional health system into an Intelligent-Health (I-Health) system that enables effective collection, management, and sharing of medical data during outbreaks. Indeed, I-Health can support diverse functions, including event detection and characterization, real-time remote monitoring, as well as identification and management of patients with high mortality risks. In the era of I-Health, all health-related services should be managed in efficient and distributed ways. Specifically, during the periods of epidemics, an intensive amount of data will need to be gathered (from diverse IoT devices), analyzed, and shared across multiple entities to conduct indepth medical studies, epidemic investigation, and improving the response time in emergency conditions. Moreover, such systems are of extreme importance since it is critical to monitor the patients' status precisely outside medical centers to minimize the patients' visits, and hence minimizing the risks of physical contact with the patient. Thus, we envision that improving the communication links between patients and healthcare providers is mandatory to enable largescale healthcare services and personalized medicine. However, remote accessibility of medical data and Electronic Health Records (EHRs) by different entities comes with processing, communications, and security challenges. Typically, traditional healthcare systems implement weak security measures which jeopardizes the security of the overall system. For instance, from 2016 to 2017, the number of reported health-related attacks increased by 89% as reported in [1] . In this work, we argue that designing an efficient, secure, and decentralized I-Health system fulfilling the aforementioned challenges can be implemented by leveraging edge computing and blockchain technologies. We envision that bringing the intelligence close to the users/patients, using edge computing, along with sharing the important data over a blockchain network is a key for detecting and managing urgent outbreaks 1 . On one hand, blockchain is a decentralized ledger of transactions that are shared among multiple entities while preserving the integrity and consistency of the data through smart contracts [3] . Hence, it effectively supports data processing and storage at different entities as well as their interconnections. Blockchain also provides traceability and audibility of transactions from multiple organizations, which plays a crucial role in tracking the supply chain of certain drugs/vaccine during adverse events. On the other hand, being decentralized allows for the potential application of edge computing, which enables a swift and portable emergency detection through identifying and monitoring infected individuals at the edge. We therefore aim at paving the way to design an efficient I-Health system that addresses the above aspects through: 1) Designing a secure and decentralized I-Health system that relies on blockchain and edge computing technologies to provide early detection, fast response, and intelligent management for urgent epidemic situations. 2) Developing an automated patients monitoring scheme at the edge. The proposed scheme allows for an accurate detection of the changes in the patients' records, hence ensures a fast notification about the patient's state, at the edge-level, while sharing important information with the different participating entities in the system. 3) Developing a multi-channel blockchain architecture with a flexible, optimized configuration model, which allows for: (i) assigning different priorities for the acquired transactions based on their urgency level and importance; (ii) optimizing blockchain channels configuration to adapt to diverse types of applications/data with different characteristics. 4) Demonstrating the effectiveness of the proposed system in improving the performance of healthcare systems using a real-world dataset. In the rest of the paper, we begin by introducing the main challenges that will be tackled in this paper, then introducing our I-Health architecture and framework (Section II). Then, Section III presents our patients monitoring scheme, while Section IV introduces our blockchain optimization model with the priority assignment task. Performance evaluation of our system is then discussed in Section V. The related work and benefits of the proposed I-Health scheme are presented in Section VI. Finally, the paper is concluded in Section VII. In this section, we first highlight the key challenges of managing infectious disease epidemics, then we present our I-Health architecture and framework to address these challenges. To track and control the spread of an epidemic (e.g., dangerous infectious diseases), piles of information from diverse locations (e.g., hospitals, clinics, and airports) as well as reports concerning disease outbreaks should be collected, processed, and analyzed. However, acquiring and sharing such amount of information between different e-health entities at different geographical locations is challenging due to: data quality, availability, timeliness, and completeness. Moreover, for effective epidemic management, an e-health system must: (i) expedite the process of information collection and investigation; (ii) provide a fast response with high quality service level and security for the entire population. To this end, the following issues have to be adequately addressed using the proposed I-Health system. Limited resources: During the times of the spread of infectious diseases (such as the recent COVID-19 outbreak [2] ), most of the hospitals are required to serve hundreds of patients daily. This could generate an intense load on the hospitals for a long time. Furthermore, such outbreaks that can spread from human to human can put the medical staff at high risk of being infected. In some recent outbreaks [4] , a number of healthcare facilities were shut down to prevent their staff from contracting the virus, rendering the traditional healthcare systems futile in such critical times. Secure connectivity: During an epidemic, secure communications is a critical tool to detect and handle the virus spreading as early as possible [5] . Indeed, real-time access to a patient's EHRs enables e-health systems to give timely care to the patients through the nearest point of care. However, medical data exchange across multiple organizations imposes major challenges on the system design in terms of network load and security. Thus, innovative methods for secure data access, analysis, and management are needed to handle the enormous amounts of data from different locations, which also help the medical staff to focus on epidemiological investigation. Monitoring infected patients: One major aspect for managing the spread of epidemics is the precise monitoring of infected patients that are part of the epidemic investigation. Hence, healthcare systems must support efficient monitoring for the patients' state, in a timely manner, even outside the hospitals. To address the above challenges, we propose the following I-Health architecture, which is comprised of diverse e-health entities whose fundamental role is to monitor, promote, and maintain people's health. The proposed I-Health system architecture, shown in Figure 1 , is divided to two main networks: (a) a Local network, and (b) a blockchain network. For the sake of scalability, we consider that the intended e-health entities gather health-related data from the local network, process these data, and share important information through the blockchain network. The shared data are validated and stored locally by the various entities in the blockchain, which are trusted entities with large storage and computational capabilities [6] . The local network stretches from the data sources located on or around patients to the Local Healthcare Service Provider (LHSP), like e.g., a hospital. It contains the following major components: a.1) Internet of Medical Things (IoMT): A combination of IoT devices attached/near to the patients to be leveraged for monitoring health conditions and activities within the smart assisted environment. Examples include: body area sensor networks (i.e., implantable or wearable sensors that measure different biosignals and vital signs), smartphones, IP cameras, and external medical and non-medical devices. a.2) Local Healthcare Service Provider (LHSP): An LHSP is a medical facility which monitors and provides the required healthcare services for the local patients, records the patients' state, and provides prompt emergency services if needed. Most importantly, the LHSP plays a significant role in monitoring the patients' state not only inside the medical facility (intramedical-facility patient care), but also outside such facilities, as e.g. home patient care related services. Also, it can be connected with the private clinics that may transfer patients to it for more advanced care, or even with the patient's close circle to follow up on the patient's conditions. As far as the blockchain network is concerned (see Figure 1) , the core is the multi-channel blockchain-based data sharing architecture that enables secure access, processing, and sharing of medical data among diverse e-health entities. Blockchain is indeed particularly suitable for secure medical data sharing because of its immutability and decentralization features, which are perfectly consistent with our proposed I-Health architecture. Using blockchain, all transaction blocks (i.e., containing health-related information) can be securely shared, accessed, and stored by physicians, decision makers, and other healthcare entities. The latter include, but are not limited to: b.1) External Edge (EE): In the proposed architecture, a hospital or a LHSP have more advanced tasks than the ones mentioned above: it can act as an EE that is responsible for data storage, applying sophisticated data analysis techniques, and sharing important health-related information with public health entities. Hence, leveraging the power of edge computing, each entity can verify the authenticity and integrity of the medical data at the EE before sharing it within the blockchain. The main role of MOPH is monitoring the quality and effectiveness of healthcare services through coordination with different health entities. MOPH waives the responsibility of healthcare services to the hands of public and private health sectors while regulating, monitoring, and evaluating their healthcare services to guarantee an acceptable quality of care. b.3) Insurance companies: One important aspect for e-health systems is integrating healthcare providers, patients, and payers into one "digitized community" in order to improve the quality of services and drive down the costs. Indeed, to realize a sustainable healthcare-business model, healthcare providers will have to own health plans powered by insurance companies. b.4) Other entities: Different entities can be also part of our I-Health system, such as National Institutes of Health (NIH) and pharmacies. The former are major players in clinical research and health education, while the latter have to coordinate with prescribers and/or private insurance companies to confirm the dosage and formulation (e.g., liquid or tablet), or to submit insurance claims and ensure payment. The ultimate goal of our I-Health system is to fulfill diverse challenges of epidemics mentioned above through implementing the following main functionality at the edge and blockchain (see Figure 2 ): (i) data collection, feature extraction, and patients' state monitoring, in order to ensure high-reliability and fast response time in emergency detection; (ii) secure data accessibility anytime and anywhere to different entities. We envision that integrating edge computing with blockchain in our I-Health framework provides a potential solution to all of the aforementioned challenges. Indeed, leveraging edge computing allows for defining when and what data to share through the I-Health system. This is essential for ensuring that the most important and up-to-date information is available for investigation. In this context, we propose an automated patients' state monitoring scheme at the edge, which enables: 1) collecting the data of different patients (inside or outside the hospital); 2) identifying specific features from the acquired data that are informative and pertinent to the patients' state; 3) detecting major changes in the patients' state leveraging the identified features. After processing the acquired information, at the edge, we define the critical events that should be shared with other entities through permissioned blockchain. A general blockchain architecture mainly consists of: data sender, Blockchain Manager (BM), and validators. First, the data senders upload their data, in a form of "transactions", to the nearby BM. Then, the BM acts as a validators' manager: it distributes unverified blocks to the validators for verification, triggers the consensus process among the validators, and inserts the verified block in the blockchain [7] . Hence, the BM acts as the leader, while the validators are the followers that cooperate to complete the block verification task. In our framework, we consider a multi-channel blockchain, where each channel corresponds to a separate chain of transactions that can be used for enabling data access and private communications among the channel users [8] . Leveraging such architecture allows for treating different health-related events effectively. In particular, we consider three channels in our blockchain, channel 1 for urgent data (such as emergency notifications), channel 2 for non-urgent data but requiring a high security level (such as confidential legal messages), and channel 3 for normal data. Accordingly, we propose three new tasks at the BM: 1) priority assignment, which aims to assign different priority levels for the received transactions from diverse entities based on their urgency level and arriving time; 2) blockchain channel allocation, which allocates the received transactions to the appropriate channel based on their urgency and security levels; 3) blockchain configuration optimization, where different blockchain configuration parameters are optimized based on diverse application requirements and data types. We remark that the BM has a logical role that any entity in the proposed architecture can take on, possibly by taking turns, or that can be taken by the leading organization that wants to share its data [9] . In what follows, we present how the above functionality can be implemented at the edge and BM. This section presents the first stage in our framework, which focuses on the edge functionality. We consider a specific case study related to remote monitoring. During epidemics, · Data collection. · Feature extraction. · Patients' state monitoring. · Priority assignment. · Blockchain channel allocation. · Blockchain configuration optimization. it is crucial to move large number of patients with mild symptoms into home care. If I-health system can adequately monitor this large number of patients, from different locations, it will conserve hospitals' facilities to absorb critical cases, which may help save more lives during outbreaks. Thus, we propose an efficient, low-complexity and automated patients monitoring scheme at the edge. The proposed scheme defines a change indicator, which measures the percentage of change in patient's records from one period to the next. Our scheme has been designed leveraging biological data that has been collected from patients undergoing routine planned treatment. The acquired data includes 14-channel Electroencephalography (EEG) signals and routine observational data, such as temperature, blood pressure, and so on. Monitoring EEG signals provides an additional source of information to help in detecting changes of the patients' state, and to monitor the dosage of hypnotic drugs [10] . Our data has been collected from 30 patients taking a specific medication during three different sessions. The three sessions represent the data of a patient before, during, and after taking the medication. More description about the data collection is presented in Section V. However, without loss of generality, the proposed scheme and methodology can be easily applied to different types of data. The proposed scheme comprises the following main steps. The first step in our changes detection scheme is identifying the main statistical features that are informative, representative, and pertinent to EEG changes detection. As shown by the signal behavior in Figure 3 , it is difficult for the doctors to differentiate and detect the changes. However, after analyzing these signals, we found that they exhibit different mean, variance, and amplitude variations. Moreover, it is crucial to consider as relevant features the Root Mean Square (RMS), i.e., a good signal strength estimator, and kurtosis, i.e., a measure of the tailedness of the probability distribution. We therefore select the following four features, in addition to the Variance Root mean square Kurtosis where x ij (k) is the values of input EEG signal for channel i and patient j, and N is the number of samples. Accordingly, for a given patient j, the above features will be calculated, for each EEG channel i, to represent the patient's state over a time window of N samples. The second step in our scheme is detecting, at the edge, the major changes in the patient's state. Hence, based on the detected changes, the edge node (i.e., a hospital) can optimize what to share on the blochchain, as follows: • in case of detecting major changes (i.e., of an emergency), it will share through blockchain an emergency notification, along with the raw data that may require further investigation; • in case of detecting minor/no changes, it will share only the obtained features; • in case of detecting major changes in one or two channels only, it means that the measurements may be inaccurate due to some errors in the experiment. Thus, it is recommended to notify the responsible physician to repeat the measurements. We exploit the extracted features to perform an initial detection to the major changes in EEG signals at the edge. The advantages of our scheme is two-fold. First, by detecting the changes in the acquired data at the edge, we can significantly decrease the amount of information to be shared on the blockchain, without missing important information in case of emergency. Second, in case of emergency, a quick alert and notification can be initiated based our scheme, hence facilitating effective analysis without wasting the physician's time. The fundamental question now is: How can we obtain a simple yet accurate classification rule using the generated features to reveal the major changes in the acquired data? First, we define a statistical indicator δ ij , for an EEG channel i and patient j, that integrates generated features as follows: Using (5), we define a change indicator vector K j = [κ 1j · · · κ Cj ] for a patient j, where κ ij is defined as In (6),δ is the statistical mean of δ, acquired during offline training, for all channels i ∈ {1, · · · , C} over all patients j ∈ {1, · · · , P }. Second, we define a classification rule using the obtained K j to detect the major changes/errors of the acquired EEG data, where K j will represent the condition part of the rule, while the status of the patient ω j will represent its consequent part. Accordingly, we obtain through our experiments the following classification rule where [a] + = max(0, a) provides a vector of either positive or 0 elements in a vector a, ||.|| 0 is the zero th norm operator, and ζ is a threshold that assesses the major changes in the EEG signal (e.g., we consider ζ = 30%). We remark that this scheme will be exploited to obtain the status of the patient at the edge, hence optimizing what to share through blockchain. Moreover, it provides a quick detection for the major changes in the patient's state, while keeping the complexity low, hence it is amenable for implementation at any mobile edge. The second stage in our framework is developing an optimized blockchain configuration model that enables sharing of different health-related events and information among diverse healthcare entities. We envision that for designing an efficient I-Health system, the acquired data from various entities should be treated in different ways, based on their urgency and security levels. For example, urgent data (i.e., require minimum latency) should be given highest priority and dealt with a restricted blockchain, i.e., with minimum number of validators. On the contrary, for low priority types of data but requiring a high security level, fully restricted blockchain should be used (see Figure 4 ). In case of normal data, i.e., that has requirements on both latency and security, an optimized blockchain configuration is used. We remark that data types and emergency levels are defined at the edge by applying different data classification, event detection, and summarization techniques, as shown in Section II-C. In general, the more validators participate in the block verification stage, the higher the security level is, but also the larger the latency (due to the verification delay) and the higher the cost (due to verification fees) that are experienced [11] , [12] . Instead, as the number of transactions per block grows, the latency increases, while the cost per transaction decreases [12] . Accordingly, the proposed blockchain optimization addresses the aforementioned challenges by designing an event-driven secure data sharing scheme, as detailed below. The proposed scheme draws on the BM concept [11] , which acts as a validators' manager, that is responsible for: 1) gathering the transactions from different entities, 2) assigning different priorities to the gathered transactions based on their urgency level, 3) updating the blockchain configuration considering urgency and security level of the gathered transactions, 4) preparing and distributing unverified blocks to the selected validators (e.g., hospitals, NIH, and MOPH, which have sufficient computation and storage resources), 5) interacting with the validators to complete block verification tasks. Thus, the BM is a critical component in our scheme, which dynamically updates the blockchain configuration's parameters, based on the diverse applications' requirements and data types, such that the optimal trade-off among security, latency, and cost is obtained. Also, we remark that, in line with the traditional consensus scheme, the validators take turns in working as BM for a given time period [11] . Before optimizing the blockchain configuration's parameters, we highlight the role of priority assignment task at the BM. This task aims to minimize the sojourn time of the received transactions from different entities based on their urgency level. Herein, the sojourn time refers to the total Fig. 4 . Blockchain modes based on the data priority and required security level. amount of time a transaction is expected to wait before being added to the blockchain. This sojourn time will be controlled by identifying different urgency levels, namely urgent, normal and non-urgent. Then, we adopt the use of queuing models to calculate the sojourn time based on the urgency levels of different received transactions. In particular, we define the sojourn time based on the preemptive-resume priority concept [13] , i.e., the transactions with a higher priority interrupts the processing of transactions with lower priorities. It is assumed that N entities (e.g., hospitals) are sending their transactions to the BM, each with an arrival rate λ i , for i ∈ {1, · · · , N }. All received transactions from different entities are temporarily stored in the BM's buffers. In this paper, buffer overflows are negligible since it is assumed that N i=1 λ i < µ, where µ is the service rate at the BM. By adopting the well-established M/M/1 queuing model [14] (and the references therein) for the received transactions with equal priorities, the average sojourn time of entity i is defined as However, to handle the received transactions efficiently, the BM assigns different priorities for them based on their urgency levels and corresponding entity weight 2 . Hence, transactions with high urgency and coming from high impact entities will be assigned the highest priority. To derive the average sojourn time for transactions with different priorities, we start from the general expression of the sojourn time which we denote by S g i , that can be calculated by applying [13, Sec. 9.2] where R i and B i are the mean service and mean residual service times of the i th entity, respectively. The adopted M/M/1 queuing model implies that we have exponential service times with mean B i = 1/µ and R i = 1/µ [13] . Hence, substituting the aforementioned results in (10) yields the following average sojourn time expression To assess the benefits of the proposed urgency priority assignment compared to equal priority assignment, we present Figure 5 , which depicts the average sojourn time versus the entity ID. In this figure, we simulate the arrival rate of 21 different entities, where each entity is assigned a different priority based on its urgency level. In particular, it is assumed that entities 1 through 8 ∈ urgent, entities 9 through 12 ∈ normal, and entities 13 through 21 ∈ non-urgent. Moreover, the packet arrival rate per entity is assumed to be a constant that equals to 2 transactions/s. The obtained results show that unlike the equal priority assignment, which obtains the same sojourn time for all entities, the proposed urgency priority assignment yields a significant reduction in sojourn time, especially for entities with an "urgent" status. We also observe that for the transactions belonging to low priority entities, the sojourn time is increased, when compared to that of the equal priority, which makes sense since it is tagged with low urgency (non-urgent). The figure also shows the effect of varying the average service rate on the obtained sojourn time. It is clear that the sojourn time increases when the service rate decreases, however, using our urgency priority assignment allows for decreasing the sojourn time of most of the entities (only three entities will have higher sojourn times than that of the equal priority assignment). We remark that service rate µ = n/L, where n is the number of transaction per block, and L is the block verification latency inside the blockchain. Thus, optimizing blockchain configuration will have direct impact on the obtained sojourn time, as will be shown later. Given the received transactions with different priorities, the BM aims at mapping these transactions into different configurations of the blockchain. The proposed blockchain optimization model considers permissioned blockchain with Delegated Proof-of Stake (DPoS) consensus algorithm 3 , which performs the consensus process using pre-selected validators [11] . Our model focuses on three main metrics at the BM, namely, latency (L), security (η), and cost (C). However, these metrics have different values and units, which must be first normalized with respect to their maximum values (denoted by l m , η m , and c m , respectively) to make them comparable. Then, to deal with such conflicting metrics, we define an aggregate utility U , which combines them into a single function: 3 Consensus algorithm is a process of ensuring the integrity and consistency of the blockchain across all participating entities [7] . where α, β, and γ are weighting parameters representing the relative importance of the considered metrics, such that α + β + γ = 1. Also, m is the number of selected validators, with maximum and minimum values equal to M and v, respectively, and n is the number of transactions per block, with maximum and minimum values equal to χ and t, respectively. Accordingly, the BM can obtain the best blockchain configuration, by solving the following optimization problem: In (13) , the cost function is defined as C = m i=1 ci n , where c i is the computational cost of validator i to finish the verification task, while the security level is defined as η = θ · m q , where θ is a coefficient given by the system, and q ≥ 2 is an indicator factor representing the network scale. L refers to the latency of the block verification process, which includes: (i) unverified block transmission from the BM to validators, (ii) block verification time, (iii) verification result broadcasting and comparison between validators, and (iv) verification feedback transmission from the validators to BM [11] . Hence, the latency is defined as where B is the transaction size, K is the required computational resources for block verification task, x i is the available computational resources at validator i, O is the verification feedback size, r d and r u are, respectively, the downlink and uplink transmission rates from the BM to the validators and vice versa. In (17) , ψ is a predefined parameter that can be obtained using the statistics belonging to the previous processes of block verification (as detailed in [11] ). Finally, in our architecture, it is assumed that the validators are offloading their computational load of the verification process to the cloud/fog providers (CFPs). Hence, validator i should buy the required computing resources x i from a CFP in order to access these resources from the remote cloud or the nearby fog computing unit [15] . Thus, for validator i to participate in the verification process, it should receive a cost c i that at least covers its payment to the CFP. This condition is represented in constraint (14), where ρ i represents the payment from validator i to the CFP, in order to acquire the needed resources for the verification process. According to the acquired data types and application's requirements, the weighting coefficients α, β, and γ are defined. Hence, the optimal number of validators m * and transactions per block n * can be obtained by solving the proposed optimization problem. However, the above optimization problem is an integer programming optimization, which is an NPcomplete problem [16] . In light of the problem complexity, we propose below a light-weight iterative approach for obtaining an efficient solution of the formulated problem. In order to efficiently solve the formulated problem in (13), we look at the problem as a block size optimization, as a function of n, and a block verification optimization, as a function of m. The block verification variable can be considered as a global variable that is relevant to the overall blockchain process, while the block size variable is a local variable at the block preparation phase. We therefore decompose the problem into the block size and block verification sub-problems, such that each of them is a function of one decision variable only and, hence, can be solved independently of the other. Then, an efficient-iterative algorithm is proposed for obtaining the optimal solution of (13) by leveraging the proposed problem decomposition. Starting by the block size problem, a closed-form expression for the solution can be obtained by imposing that the derivative with respect to n of the objective function is equal to 0, while considering m as a constant. I.e., Thus, the optimal n is given by: Considering block verification optimization, an efficient Blockchain Configuration Optimization (BCO) algorithm is proposed (see Algorithm 1). BCO algorithm leverages the idea of problem decomposition to find the optimal solution of (13) in practical scenarios, where different validators have different verification response time. The main steps of BCO algorithm can be summarized as follows: 1) BM distributes unverified blocks to the validators. 2) Validators that finish block verification faster are selected one by one. 3) Given the selected validators (m), n is calculated, using (19) , and approximated to the nearest integer. Then, n * is obtained, such that the constraint in (16) is satisfied. 4) After adding a new validator, we check the "gain" condition, i.e., the obtained reduction in the security term (i.e., β · η −1 ) is greater than the obtained increase in the latency and cost terms (resulting from adding the new validator). If the "gain" condition is satisfied, this validator is added to the selected validators, otherwise it is discarded and m * is obtained. We remark that the maximum number of iterations for the BCO algorithm to converge to the optimal solution is M , thanks to the derived closed-form solution for n * . Calculate n using (19) . 4: if n < t. then if β ·η −1 (m−1)−β ·η −1 (m) < (α·L(m)+γ ·C(m))− (α · L(m − 1) + γ · C(m − 1)) then 12: m * = m − 1. Break % m * is obtained 14: end if 15: end for 16: Output: m * , n * . For our performance evaluation, we use the data in [17] that has been collected from patients undergoing routine planned treatment. The data collection process has been carried out in the patient recovery center of Hamad Medical Corporation [18] . The acquired data has been collected using EMOTIV EPOC+, which comprises 14 EEG channels (i.e., electrodes) 4 for whole brain sensing [19] , in addition to the routine observational data such as temperature and blood pressure. This data has been collected from 30 patients receiving intravenous antibiotic medication. Each patient has been monitored for 30 minutes: before, during, and after taking the medication. Moreover, our results were generated considering 21 entities, where the packet arrival rate per entity is assumed to be uniformly distributed with mean equals to 1 transactions/s. Channel index (f) The first aspect we are interested in is identifying the changes in the acquired patients' records at the edge using the proposed patients monitoring scheme. To this end, Figure 6 demonstrates the variations in the defined change indicator δ over different EEG channels for six patients. This figure highlights that using the defined change indicator, a physician can easily interpret the EEG behavior of a patient before, during, and after taking a certain medication. For instance, patients 1, 4, and 5 have a clear increase in their EEG records after taking the medications, while patients 2 and 3 having almost the same behavior before, during, and after taking the medication. Interestingly, our scheme can also detect the errors in collecting the data. For instance, patient 6 has a very large value of δ for channel 14 only, which indicates that there is a problem in this channel during data collection. Hence, the physician should repeat this experiment for this patient before conducting further data analysis. The second aspect we are interested in is the impact of blockchain configuration optimization on the different performance metrics. First, Figure 7 depicts the effect of changing the blockchain configuration parameters (i.e., number of validators m and number of transactions per block n) on the obtained utility function in (12) , for applications with similar requirements in terms of security, latency, and cost (α = β = γ). It is clear how changing the configuration parameters always corresponds to a significant change in the utility. Thus, it is important to optimize these parameters considering diverse applications' requirements and system performance. As far as the blockchain configuration optimization is concerned, Figure 8 shows the convergence behavior of the proposed BCO algorithm to the optimal solution obtained by exhaustive search, given M = 21 and N = 20. We observe that our algorithm requires only 7 iterations to reach the optimal solution compared to exhaustive search that still does not converge after 420 iterations. We now study, in Figure 9 and Figure 10 , how changing blockchain configuration on different channels influences the performance. The plots in Figure 9 represent the main performance metrics considered in our framework (i.e., latency, security, and cost) as a function of the number of iterations until reaching to the convergence. Each curve therein corresponds to a channel configuration, and each plot corresponds to a performance metric. The configuration of the channels from 1 to 3 has been optimized using the proposed BCO scheme, while the configuration of channels 4 is assumed to be fixed, considering a fixed number of validators (i.e., m = 8) and a fixed number of transactions per block (i.e., n = 80). Herein, it is assumed that channel 1 is used for urgent data, channel 2 for normal data, and channel 3 for non-urgent data. Comparing the individual curves within each plot, we can observe how our BCO algorithm efficiently adjusts different channels configurations according to the acquired data characteristics, such that the urgent data are sent by the lowest latency and computational cost, while the non-urgent data (i.e., require high security without latency constraint) are sent with the highest security level. Moreover, it clearly illustrates the tradeoff between increasing the security level and decreasing the latency. Thus, this result shows that it is important to have multiple channels with different configurations within the same blockchain to be able to adapt to diverse types of applications/data with different characteristics. Finally, we assess how much, and for whom, our priority assignment scheme is beneficial. Figure 10 depicts how, for different channels configurations, priority assignment influences the obtained sojourn time; different curves correspond to different channels with and without considering priority assignment. This figure highlights that assigning different priorities for different entities in the system (based on the urgency levels or the entity weight) yields a substantial decrease in sojourn time for high-priority entities, hence they can share their transactions with a substantially smaller delay. This section highlights the key benefits of I-Health, in light of the recent-related literature. Outbreak data management have attracted major attention, with several works focusing on monitoring new virus outbreaks, such as COVID-19 pandemic [20] and west Africa Ebola epidemic [21] . However, large-scale data collection and processing while considering privacy and public trust is challenging [22] . Relying on a centralized entity or web resources [23] for emergency events detection will not be adequate in case of epidemics. Traditionally, public health systems deploy personnel in areas where the epidemic is centered, to collect relevant information. This usually results in physically contacting infected individuals [24] . Then, data analysis and epidemic management are performed in a central entity using the received periodic information from the infested areas. For instance, during the severe acute respiratory syndrome (SARS) outbreak in Toronto, an important step to perform seamless outbreak management was building an outbreak management database platform. This platform enables the sharing of public health information, gathering clinical information from hospitals, and integrating them into an interoperable database [25] . With the help of IoT and recent technologies, containment and eventual treatment of outbreaks can be run more smoothly. Thanks to the advances of edge computing and blockchain technologies, designing a secure, collaborative health model to implement the integration of multiple national and international entities is now more realizable than ever before. The power of security in blockchain comes from the collective resources of the crowd, since, most of the entities have to verify each block of data using a consensus algorithm, e.g. DPoS [7] . Hence, any cyber attack has to beat the resources of the whole crowd collectively to be able to hack the integrity of the data, which makes attacks to the blockchain impractical [26] , [27] . Recently, different types of blockchain have been envisioned for the healthcare sector, including permissioned and permissionless blockchains. Permissionless blockchains offer decentralized and secure data sharing, however, when advanced control and privacy are required, private or permissioned models turn to be more efficient. Several blockchain frameworks (e.g., Ethereum and Hyper ledger Fabric), smart contracts 5 , and consensus algorithms have been investigated in the literature [28] - [30] . The blockchain architectures that have been proposed so far in the literature can be broadly classified into two categories: patient-based and entity-based. In patient-based architectures, patients participate in the blockchain [31] , [32] ; in entity-based architectures, instead, health organizations, hospitals, research institutes, and alike are the main actors, while patients only interact with the health organizations to acquire the service they need [33] . For instance, [7] exploits blockchain to link patients, hospitals, health bureaus, and diverse healthcare communities for enabling comprehensive medical records sharing and review. [34] presents a user-centric medical data sharing solution, where a mobile application is used to gather the data from wearable devices, then sharing the data with healthcare providers and insurance companies using permissioned blockchain. [35] introduces a blockchain-based system that enables data provenance, auditing, and control over shared medical data between different entities. This system utilizes smart contracts and an access control scheme to detect malicious activities on the shared data and deny access to offending entities. However, most of the aforementioned approaches suffer from poor scalability, computational cost, and slow response. We therefore envision a solution that combines the blockchain-enabled architecture with intelligent processing at the edge so as to support fast, secure and scalable exchange and processing of medical data. A preliminary version of our study has been presented in [36] , where only a singlechannel blockchain architecture is considered without edge functionality and priority assignment. In the light of the aforementioned challenges and initiatives, we highlight the practical benefits of leveraging the proposed I-Health system during the epidemics. The proposed I-Health system allows for the timely monitoring of the changes in the patients' state and when those changes occur. Leveraging the advances of edge computing and blockchain within I-Health framework enables real-time remote monitoring for quarantined patients. This, in one hand, allows the doctors to communicate with the patients while monitoring their vital signs remotely, and on the other hand, it minimizes the physical interactions between the medical staff and the patients while reducing the patients' flow to the overcrowded hospitals. Moreover, the fast dissemination, processing, and analysis of medical data using I-Health have been perceived to be crucial for speeding up the process of finding adequate medications for emerging diseases. We also highlight that the proposed architecture allows for implementing efficient localization techniques at the edge (such as the one in [37] ), hence it can enable patients monitoring and tracking, which is important in case of epidemics. 2) Remote accessibility of medical data: By supporting a secure, remote access to the patients' EHRs using I-Health, the medical staff can timely review the records from various locations to gather important information about different infected cases. This can significantly accelerate data analysis and health learning curves. Moreover, sharing relevant data between different healthcare entities could help in: providing fast response to epidemics, improving nation wide statistics, and enhancing the quality of service. 3) Patients' flow management: Optimizing patient flow aims at quickly and effectively fulfilling the demand of healthcare by managing and correlating the data related to the patients across multiple entities. Poorly managed patients flow is not usually due to insufficient resources, but due to inefficient scheduling and resource management. This can be addressed using I-Health, which enables the cooperation between diverse health entities to efficiently allocate the available resources to the forthcoming demands. VII. CONCLUSION Next-generation healthcare systems are being shaped by incorporating emerging technologies to provide radical im-provements in healthcare services. Thus, this paper proposes a novel, collaborative I-health system for enabling effective and large-scale epidemics management. The proposed I-Health system leverages IoT, edge computing, and blockchain to provide secure management of large amount of medical data generated by various health entities, while effectively addressing the challenges and requirements posed by epidemics. In particular, we propose an effective method for monitoring the patients, at the edge, to ensure early detection, scalability, and fast response for urgent events. Furthermore, we develop an optimized blockchain configuration model with a queuingbased priority assignment scheme to optimally manage the received transactions from diverse entities. Our results show that mapping the characteristics of the gathered data onto adequate configurations of the blockchain can significantly improve the performance of the overall I-Health system, while fulfilling different health entities' requirements. Healthcare report for 1st half Coronavirus disease (COVID-19) outbreak Deep shift: Technology tipping points and societal impact Can the health-care system meet the challenge of pandemic flu? planning, ethical, and workforce considerations Hospitals face a surge of cyberattacks during the novel coronavirus pandemic A scalable blockchain framework for secure transactions in IoT Blockchain-powered parallel healthcare systems based on the ACP approach Hyperledger fabric: a distributed operating system for permissioned blockchains Incentivizing consensus propagation in proof-of-stake based consortium blockchain networks Practical Guide for Clinical Neurophysiologic Testing: EEG Toward secure blockchain-enabled internet of vehicles: Optimizing consensus management using reputation and contract theory Information propagation in the bitcoin network Reducing service deployment cost through vnf sharing Cloud/fog computing resource management and pricing for blockchain networks Nonlinear Integer Programming EEG data for patients receiving intravenous antibiotic medication Hamad medical corporation On the responsible use of digital data to tackle the COVID-19 pandemic The epi info viral hemorrhagic fever (vhf) application: a resource for outbreak data management and contact tracing in the 2014-2016 west africa ebola epidemic I can see your brain: Investigating home-use electroencephalography system security From latency, through outbreak, to decline: Detecting different states of emergency events using web resources The cdc field epidemiology manual Learning from SARS: Renewal of public health in canada Healthchain: A blockchain-based privacy preserving scheme for large-scale health data Blockchain: A panacea for healthcare cloud-based data security and privacy? Healthcare blockchain system using smart contracts for secure automated remote patient monitoring Medical data management on blockchain with privacy Privacy-friendly platform for healthcare data in cloud based on blockchain environment Blockchain based searchable encryption for electronic health record sharing MedChain: efficient healthcare data sharing via blockchain Towards secure and privacy-preserving data sharing in e-health systems via consortium blockchain Integrating blockchain for data sharing and collaboration in mobile healthcare applications MeDShare: trust-less medical data sharing among cloud service providers via blockchain SSHealth: Toward secure, blockchainenabled healthcare systems Multimodel framework for indoor localization under mobile edge computing environment