Internet of Things for Sensing: A Case Study in the Healthcare System

: Medical healthcare is one of the fascinating applications using Internet of Things (IoTs). The pervasive smart environment in IoTs has the potential to monitor various human activities by deploying smart devices. In our pilot study, we look at narcolepsy, a disorder in which individuals lose the ability to regulate their sleep-wake cycle. An imbalance in the brain chemical called orexin makes the sleep pattern irregular. This sleep disorder in patients suffering from narcolepsy results in them experience irrepressible sleep episodes while performing daily routine activities. This study presents a novel method for detecting sleep attacks or sleepiness due to immune system attacks and affecting daily activities measured using the S-band sensing technique. The S-Band sensing technique is channel sensing based on frequency spectrum sensing using the orthogonal frequency division multiplexing transmission at a 2 to 4 GHz frequency range leveraging amplitude and calibrated phase information of different frequencies obtained using wireless devices such as card, and omni-directional antenna. Each human behavior induces a unique channel information (CI) signature contained in amplitude and phase information. By linearly transforming raw phase measurements into calibrated phase information, we ascertain phase coherence. Classiﬁcation and validation of various human activities such as walking, sitting on a chair, push-ups, and narcolepsy sleep episodes are done using support vector machine, K-nearest neighbor, and random forest algorithms. The measurement and evaluation were carried out several times with classiﬁcation values of accuracy, precision, recall, speciﬁcity, Kappa, and F-measure of more than 90% that were achieved when delineating sleep attacks.


Introduction
The Internet of Things (IoT) is a concept reflecting a connected set of anyone, anything, anytime, anyplace, any service, and any network [1]. The Internet of Thing is a discussion and trend that has been going on in the tech industry for a while. There are two big things to note about IoTs; first, the average individual does not leverage it greatly. Second, IoTs takes analog ideas or devices, such as sensors, actuators, home appliances etc., and connects them through inter-networking [2].
IoTs provides appropriate solutions for a wide range of applications such as smart cities, traffic congestion, waste management, structural health, security, emergency services, logistics, retails, industrial control, and health care [1].
Medical healthcare is one of the fascinating applications for IoTs. The pervasive smart environment leveraging IoTs has a potential to monitor various human's activities by the deployment of smart devices. Recently, in the medical healthcare domain, the research focus has moved toward human activity recognition. Daily routine activities have a prospect to be monitored and supported by IoTs. Patient's activity detection is a vital issue for caregivers with adequate information about the subject can be documented in healthcare systems. Activity recognition enables nurses or caretakers to provide timely assistance. For instance, in a pervasive environment, a caregiver can monitor activity using devices such as a computer or mobile phone to provide instant care for subject in risky situations [3]. For these reasons, we seek to incorporate small wireless devices used in S-band sensing technique to monitor the sleep attacks of patients suffering from narcolepsy disease (ND).
Narcolepsy is a neurological disorder in which individuals lose the ability to regulate their sleep-wake cycle. The normal cycle between sleeping and being awake is blurred, leading to sleeping excessively during the day [4]. It is an impairment with symptoms such as acute drowsiness and falling asleep without any prior warning. Loss of orexin neurons in the brain is attributed to the disruption of transitions between sleep-wake states [5]. People suffering from narcolepsy disorder have fewer excitatory neurons, and each neuron carries less of the neuropeptides orexin A and orexin B [6]. These orexins increase the activity of wake-promoting regions of the brain, thereby tipping the scales in favor of wakefulness and preventing inappropriate transitions into a sleeping state. ND primarily damages the neurons delivering orexin, and therefore less orexin is sent out and sleep-related symptoms start to intrude into wakefulness. ND can be triggered by activities such as walking, exercise, etc. or sudden, strong emotions like anger or excitement [7]. Narcolepsy sleep episodes typically last up to few minutes.
In a nutshell, patients suffering from narcolepsy fall asleep involuntary while doing daily activities. Continuous monitoring of ND patients, for targeted treatment-particularly the elderly-is of the utmost importance to avoid the risk of injury or to shed light on its triggers [5]. Thus, to monitor the daily routine activities of ND patients, we use the S-Band sensing technique leveraging wireless devices such as card, omni-directional antenna, etc. Each human activity generates a particular wireless channel information imprint in terms of variances of amplitude and phase information that is used to detect various human activities for sleep attack experiences by ND patients. The amplitude and phase information obtained are classified using support vector machine (SVM), K-nearest neighbor (KNN), and random forest (RF) for identifying sleep attacks.

Related Work
Human activity recognition for various applications has attracted much attention from researchers around the world. Applications include fall detection [8], activity detection for energy saving at homes or offices [9], 24-hour sleep-wake monitoring in narcolepsy [10], a detection system for motion disorders in Autism patients [11], and other uses leveraging IoTs [12][13][14][15][16][17][18]. The methods introduced in [13,14] leverage body sensor nodes powered by human energy harvesting and wireless sensor networks for remote patient monitoring. Cretikos et al. [19], Pantelopoulos et al. [20], and Coronato et al. [14] introduced systems for monitoring vital signs in medical problems. Many chronic diseases as in [20,21] can be forecasted and prevented using activity recognition. However, recording such information in a timely manner is a daunting task. Several methods have been proposed both in academia and in the industry for healthcare informatics and can be categorized as non-invasive sensors [22][23][24], and invasive sensors [25][26][27]. Currently, invasive sensors are a rich source of information as far as healthcare is concerned. However, some invasive sensors are uncomfortable and not suitable for everyone since patients suffering from Parkinson's disease, narcolepsy, skin diseases, and infants are not encouraged for wearing such sensors [22] or to be deployed on their bodies. Qi et al. [27] propose RadioSense, a prototype system of ZigBee radio-based activity sensing leveraging Institute of Electrical and Electronics Engineers (IEEE) 802.15.4 specifications. Thus, the non-invasive sensors might be the only solution for patients with the aforementioned diseases. Various technologies have successfully demonstrated the efficacy of non-invasive sensors. Kaushik et al. [28] proposed a non-invasive system leveraging a pyroelectric infra-red detector. Zhou et al. [29] developed video-based system detecting various activities with good classification accuracy but raised privacy concerns. Tsutsui [23] utilized ultrasound echo to detect different human movements, but the system provided poor coverage range. Li et al. [30] used Doppler radar for fall detection and gait analysis with adequate performance. Zhang et al. [31] exploited an ultra-wide-band (UWB) radar system for vital signs monitoring. However, the aforementioned technique leveraging radar faces limitations such as infrastructure deployment, spectrum licensing, and the fact that it requires specialized hardware. This paper presents a novel method leveraging the S-Band sensing technique using IEEE 802.11 specifications operating at 2.4 GHz exploiting wireless devices such as a card, antennas, etc.

S-Band Sensing and Data Processing
The proposed method uses the S-Band sensing technique for tracking human activities. The S-Band sensing technique exploits wireless channel information to obtain signals by use of wireless devices such as an omni-directional antenna as a receiver, and a card that is connected to the receiving antenna.
The S-Band sensing technique is channel sensing based on frequency spectrum sensing using the orthogonal frequency division multiplexing transmission at 2 to 4 GHz frequency range. The transceiver has higher efficiency because it uses frequencies that are orthogonal increasing the robustness. The orthogonal frequency division multiplexing is composed of 64 frequencies spaced 312.5 KHz apart [32]. The spacing is selected because of the FFT sampling size. The IEEE 802.11n uses 52 frequencies for data, eight as null frequencies, and four as pilot carriers over a channel. The card primarily reports 30 different frequencies for data processing and form one channel information (CI) packet. The main advantage of obtaining multiple frequencies is that any one or more than one frequencies can be used for analysis.
The wireless channel parameters such as carrier frequency, bandwidth, delay spread, and Doppler spread are extremely sensitive to variations in the spatial domain, causing multipath fading. We thus use such CI data that are affected by multipath reflections generated by human motion in a room or free space with a transmitting-receiving antenna. To discern the signals amplitude and phase information unique to motion, we need a second level of processing. The variances of amplitude and phase information for activity recognition generated by motion have to be looked at for uniqueness in their CI signatures.
The method we present efficiently detects various human activities such as walking, squatting, sitting on chair, pushups, and narcolepsy sleep attacks using the S-band sensing technique, which can be reported in a human understandable format. The raw phase information retrieved via the network interface card is extremely random and inapplicable for the detection of sleep episodes. Hence, the proposed design fully exploits both amplitude and calibrated phase information by applying a linear transformation on the raw phase data discussed in the subsequent section. Furthermore, SVM, KNN, and RF classifiers are used to segregate human activities and detect sleep episodes. The performance metrics such as accuracy, precision, recall, specificity, Kappa, and F-measure were used to evaluate the three classifiers.
An RF signal is received from a transmitter through multiple paths in an indoor environment when the transceiver pair is connected via network interface card. The received signal can be expressed as Here, Y and X denote the received and transmitted signals, respectively, for jth frequency. The CI data is the wireless channel information; that carries the channel frequency response (CFR) and N is the random noise. The raw CI data can be denoted as follows: where WCI j represents the amplitude information and ∠WCI j is the phase data for all j = [1,30]. A packet or channel matrix specifies the amplitude and phase information measured for a certain period of time. The wireless channel information over a time period for a particular frequency can be expressed as Here, j is the particular frequency number and z is the total number of CI packets received.

Phase Calibration
The phase data extracted from wireless CI stream is largely random and inapplicable for detecting Narcolepsy sleep episodes due to the presence of random noise and phase offset between transceiver pair. Thus, to mitigate the impact of random noise from the CI phase data and remove the phase offset, we use linear transformation on raw phase data.
Let ∠WCI ∧ j represent the measured wireless CI phase data for jth frequency.
Here, ∠WCI is the true phase data, N is the random noise, τ is the unsynchronized timing between transceiver, and β is the unknown phase offset. The frequency indices k j for j = [1,30] and FFT size Z can be obtained from IEEE 802.11n specifications [33]. The unknown terms τ and β listed above make it infeasible to obtain useful phase information solely from S-band sensing technique. Thus, to remove the unknown terms, we apply a linear transformation to the raw CI phase data across the frequency bands [34].
Let the two terms L and M represent the slope of the CI phase and phase offset considering overall frequency bandwidth, respectively.
By subtracting the linear term Lk j + M from raw CI phase data, we get the calibrated phase information ∠WCI • j [10], denoted as

Data Classification
Data classification is the process of categorizing data sets into different forms, types or any other distinct class. There exist several data classification techniques such as K-nearest neighbor (KNN) [35], neural networks (NN) [36], Random Forest (RF) [37], and support vector machine. In this paper, we have compared several data classification techniques such as the support vector machine, KNN, and RF algorithm.

Support Vector Machine for Data Classification
The advantage of using the SVM algorithm is that it provides efficient performance when it comes to practical problems [38,39]. Also, the inner-product kernel functions of SVM solve the linearly non-separable problems in higher dimension space.
The support vector machine is applied to classify subject's various activities such as walking, squatting, push-ups, sitting on a chair, and sleep episodes due to ND. The SVM is applied to the measured CFR data received using the S-band sense. SVM is a binary classifier developed for non-linear boundary problems [40]. A hyper-plane is used as a decision boundary to classify the two datasets. The closest data points to the hyper-plane, which impart construction of the hyper-plane, are called support vectors [41]. The optimum hyper-plane can be written as follows: here w denotes the weight vector, x is the input vector and c is the bias. Support vectors representing each class are expressed as The optimum hyper-plane for training sample data is expressed as where i = 1, 2, 3, . . . , n. The inner product kernel functions used in this paper are shown in Table 1. Table 1. Inner product kernel functions.

Linear
x Since we need to differentiate the ND sleep episodes from other four human activities, we adopt a one-versus-rest approach using SVM. The CFR data comprising amplitude information for the individual frequency and calibrated phase information is discussed in Section 3. Data obtained using S-band sensing techniques were processed to extract features for classifying various human activities accurately. The feature selection technique is important to reduce the number of operations and to represent the key changes against the amplitude or phase.
Various human activities can be classified using time-domain analysis, frequency-domain analysis, and time-frequency domain analysis [39]. The time-domain features can be easily extracted since they are the simplest ones, as compared to the frequency-domain and time-frequency domain features. In time-domain approaches, the time-domain waveform is analyzed directly to extract statistical indices such as the root-mean-square amplitude, skewness, and kurtosis [31]. Frequency-domain approaches are usually employed to find the characteristic frequencies via frequency analysis, such as the Fourier spectrum, cepstrum analysis, and the envelope spectrum [42]. This approach is also simple and characterizes an intuitive nature by allotting the components to their corresponding frequency in a particular spectrum. Time-frequency domain approaches including wavelet analysis, the fast Fourier transform (FFT), Wigner-Ville distribution, and Hilbert-Huang transform, etc., investigate waveform signals in both the time and frequency domain and can provide more information about the data classification [43,44]. However, this approach is essentially more complicated than the frequency-domain or time-domain approaches in a practical scenario. In this study, we use 10 time-domain statistical features as listed in Table 2. Here, x i denotes a particular frequency of choice while x denotes the signal of every frequency. Table 2. Ten features used to train and test support vector machine (SVM).

K-Nearest Neighbor Algorithm
K-Nearest Neighbor (KNN) is a simple data classification method that takes k number of nearest training samples in the feature space. KNN algorithm works on a dataset that is classified by its neighbors based on majority vote. The dataset is assigned to a particular class that is common in the k nearest neighbor defined by the distance function. For example, when k = 1, the dataset is assigned to the nearest neighbor class. There are three main distance functions used in KNN algorithm considering continuous variables.
In a case where categorical variables exist, Hamming distance as in Equation (13) should be used. When there is a combination of numerical values and categorical variables in a given dataset, the issue of standardization arises as the numerical variables are between 0 and 1. The optimum value for k is chosen by thorough inspection of the given datasets. Generally, when the value of k is large, the overall noise is reduced. Cross validation or rotation estimation is another method to identify the optimal value for k.

Random Forest Algorithm
Random forest algorithm is another power machine learning algorithm that is capable of performing classification tasks. RF algorithm is combination of different but simple predictors that can decrease the computational cost and obtain better performance [45]. Employing the regression tree as the learning algorithm of sub-models, the random forest is a modified version of Bagging [45]. In random forest algorithm, the random selection features grow a tree on the new training datasets at every node to identify the split. The RF algorithm reduces the complexity in following ways: the parallel computing procedure in combination with parallel ensemble, and the introduction of the sub-model at each sample subset with no communication from the CPU [45]. The construction of the sub-models built on the subsets dramatically decreases the training samples. The bootstrap replications, such as sample subsets, are simple and maintain very low complexity. Also, the learning algorithm of the sub-models is considered to be the regression tree.

Experimental Setup
We implemented the experiment in a large room (25 m × 25 m) as shown in Figure 1. The experiment had two parts. In the first part, microwave-absorbing materials were deployed along the walls. Three tables, three chairs, and two persons at one time, one taking the measurements and a subject, were present inside the room, as shown in Figure 1a. The main reason for using microwave-absorbing material was to reduce multipath reflections that could affect the experimental results. In the second part, as indicated in Figure 1b, the experimental design was the same, but the microwave-absorbing material was removed, and it was observed that the percentage accuracy (described in Table 3) slightly decreased due to multipath propagation. S band antenna was deployed as a transmitter, and an omni-directional antenna served as a receiving antenna. The transmitter and receiver were placed 15 m apart at a 1-m height. The receiving antenna worked as the detection point. A channel information collection tool introduced by Harpin [33] was installed in the host computer would constantly receive 20 wireless CI packets per second. In order to differentiate the ND episodes from other daily activities, we tested five body motions: walking, squatting, push-ups, sitting on chair, and subject falling asleep due to narcolepsy. Each body motion disturbed the wireless medium; as a result, a unique CI signature was recorded, indicating a particular human activity. The experiments were performed for 16 ND patients.

Results and Discussion
This section describes the simulation results obtained during the experiment. Firstly, we examine the CFR obtained for five human activities such as sitting on a chair, walking around the room, push-ups, squatting, and sleep episodes due to ND, as shown in Figure 2.  Figure 2 describes the CFR data for various human activities, transitioning from one activity to another over a period of time. We analyze each human activity that has induced a particular CFR pattern. For example, when the subject was sitting on a chair, the corresponding amplitude information against 30 frequencies is almost stationary, as evident in Figure 2a, but as the person started walking, the wireless medium constantly got disturbed, and as a result, the CFR data also changed, as in Figure 2b. On the other hand, slight variances in amplitude information against the 30 frequencies can be observed in Figure 2c when the subject was performing push-ups on the ground. Figure 2e describes the results of squatting. When the person experienced sleep episodes, due to which no large-scale movement was observed within wireless range, the amplitude information remained stationary. To further validate our point, we looked into the CI signatures generated by various activities considering the calibrated phase information and analyzed the data shown in Figure 3. Analyzing the calibrated phase information for corresponding human activities, we can clearly see that each human behavior has generated a particular registration as far as calibrated phase is concerned. A cluster of stationary data can be seen in Figure 3a that indicate sitting. Looking at activities such as motion or sitting, we are able to differentiate them with raw data and also with an SVM. Unlike a sitting posture, significant variances in the calibrated CI phase information can be seen in Figure 3b when a person starts walking within the area of interest. When the subject makes the transition to push-ups, two chunks of data can be seen in Figure 3c. Similarly, the phase information changes when the person is squatting. Finally, Figure 3e shows the stationary data when a person experienced sleepiness. In order to discuss the time history of narcolepsy sleep attacks, we analyze the acquired signal, as seen in Figure 4.  Figure 4 shows that 1400 packets in total were received for 1400 s when the experiment was being performed. A frequency # 15 was selected for amplitude-vs.-time history analysis as in [44]. We can see that the amplitude levels for sleep episodes fluctuate between 5 dB to 10 dB from 1150 s to 1350 s are clearly different from the other four activities. However, the power levels for walking and push-ups remain the same for a certain period of time. Similarly, there are moments where the power level of push-ups, walking and sitting activity are similar. Thus, to classify the different human activities and detect the ND sleep episodes accurately, we use the support vector machine.

Results Obtained Using SVM
As discusses in an earlier section, the proposed method utilizes two parameters for evaluation: the variances of amplitude information and calibrated phase information when the subject performs various activities. We adopted the one-versus-rest approach and trained the SVM classifier using built-in function in MATLAB called "svmtrain" and obtained the optimal decision boundary by utilizing the sequential minimal optimization solver. In order to train the SVM, 40, 80, and 120 samples from each class were used separately. The 10 SVM features extracted from training data are indicated in Table 2. Each one of them describes the measurement per CI packet distinctively. The results in this particular table indicate the percentage accuracy, which is one of the six performance metrics used in this paper. We have explored the remaining metrics along with accuracy in a later part of this paper. The data classification results using the SVM algorithm are described in Table 3 using microwave absorbing material and without using microwave absorbing material, respectively. The first column in Table 3 indicates the type of SVM kernel function used for training data set, and the second column denotes the training samples (40, 80 and 120). The remaining five columns a, b, c, d, e representing the sitting, walking, push-ups, squatting, and sleep attacks describes the percentage accuracy. The results indicate that when the linear kernel function was used to differentiate the five human activities from 40 training samples, the percentage accuracy is 98.75% for sitting, 78.25% for walking, 98.25 for push-ups, and 65% for sleep attacks. Similarly, the accuracy rate is around 65% for sleep attacks using linear kernel function when 80 and 120 training samples were considered, as shown in Table 3. An increase in the training dataset marginally improved the accuracy rate for sleep attacks but remained around 65%. However, the percentage accuracy greatly improved when the ten SVM features were considered using linear kernel function. The accuracy is between 75.25% and 98.5% for 40 training samples, 78.2% to 98.75% for 80 training samples, and 78% to 99% for 120 training samples. The accuracy rate of sleep attacks detection for 40, 80, and 120 training samples is 84%, 87%, and 89.75%, respectively, as shown in Table 3. The polynomial kernel function worked better than linear kernel function. The error rate is between 69.25% and 98.5% for 40 training samples, 71.5% to 99.5% for 80 training samples, and 74.25% to 99% for 120 training samples when the polynomial kernel function was used as far as five SVM features were considered. The accuracy rate obtained for the RBF kernel function is between 74% and 98% when five SVM featured were used, as shown in Table 3. However, the polynomial kernel function and RBF kernel function provided the best results when 10 SVM features were used. The accuracy rate obtained using polynomial kernel function considering ten SVM features is between 81% to 98.5% for 40, 80, and 120 training samples, respectively. While the percentage accuracy is between 78.75% and 98.75% when 10 SVM features were used, considering the RBF kernel function. However, we observe a slight decrease in percentage accuracy when the experiment was performed without microwave-absorbing material. The results obtained are shown in Table 3. Table 3 indicates the comparison between the three SVM kernel functions used for transforming the data. We observe that the accuracy rate is decreased by 5-7% without deploying microwave-absorbing material in the indoor environment. We further investigate the results obtained using KNN and RF algorithms.

Data Classification Using KNN and RF
The data collected using S-Band sensing technique was then classified using KNN and RF algorithms [45][46][47]. The former classification method is based on supervised learning where voting criteria classifies the new objects. The nearest object k from the training datasets is considered that assigns a new object to a particular class based on the majority votes. The training procedure of the KNN classification method includes storing of features and class label of the particular training datasets. In classification procedure, the most frequent training samples k assign an unlabeled object of a particular class. Various distance parameters are used in KNN algorithm as discussed in Equations (10)- (13). In our case, we have used Euclidean distance as in Equation (12) and set the value of k to 1, which implies that the selected class label was exactly the same as the one nearest to the training dataset On the other hand, the RF classification method primarily integrates a set of independent decision tree classifiers [48]. A decision tree in an RF classifier with N number of leaves divides the feature space into N number of regions such as R m , 1 ≤ m ≤ N. The prediction function f (x) for each tree is described as Here, N indicates the total number of regions in a feature space, R m corresponds to the m region, c m represents a constant number that corresponds to m, and describes the indicator function.
The final decision function for random forest algorithm is based on majority vote of all the trees. In our case, we have used an RF classification method with 100 trees.
We now discuss the data obtained using KNN and RF algorithms in terms of accuracy, precision, recall, specificity, Cohen's Kappa coefficient, and F-measure. The formulae for six performance metrics are discussed as follows: Accuracy is a fraction of instances that are correctly classified [46], Precision is estimated as a ratio of true predictions pertaining to a class [46].
Recall is the fraction of relevant instances that have been retrieved over the total amount of relevant instances [47].
Kappa is the accuracy of the system to the accuracy of the random system.
Specificity measures the proportion of negatives that are correctly identified.
F-measure is the harmonic mean of precision and recall.

Results Obtained Using SVM, KNN, and RF Classifiers
The KNN and RF classifiers were trained and tested using 120 samples. The confusion matrices obtained for SVM, KNN, and RF classifiers are shown in Table 4, respectively.
Based on these confusion matrices, we have obtained the values of six performance metrics as shown in Table 5. Table 5 shows the accuracy, precision, recall, specificity, F-measure, and Kappa values obtained using support vector machine. In the earlier section, we discussed the percentage accuracy using three kernel functions considering 10 SVM features. The accuracy presented in Table 5 is obtained using the RBF kernel function considering 10 SVM features, as shown in Table 3. The precision for all five human activities is more than 90%, while for sleep attack, it is 94%. The recall values received using SVM vary between 91% and 94.4%. The specificity obtained is more than 96% for all activities. The F-measure values also vary between 90% and 95.4%. The average Cohen's Kappa coefficient value obtained for all five human activities is 0.925. Table 5 indicates the six performance metrics received using KNN classifier. The accuracy for sitting, walking and squatting is 94.8%, 92.8%, and 90.2%, respectively.
The accuracy rate for push-ups, and sleep attack is 86.6% and 88.5%, respectively. The precision values for walking and squatting are below 90%, while the rest of the three are above 90%. The recall values for push-ups and sleep attacks are 86.6% and 88.6%, respectively. The other three values are above 90%. The specificity is more than 90% for all five human activities. The F-measure values for all human activities are near to 90% except squatting activity (87%). The average Cohen's Kappa coefficient for all five activities is 0.811.  We further examine the results obtained using random forest algorithm as shown in Table 5. The accuracy rate for sitting and walking is approximately 87%. For push-ups, the accuracy is 88.1%, while for squatting and sleep attacks, the accuracy rate is approximately 91%. Looking at the precision values, sitting has a received value of 87.5%, walking has 80.0%, and the rest have received values of more than 90%. The recall value for sitting and walking is approximately 87%, the push-ups value is 88.1%, and for squatting and sleep attacks, the value is approximately 91%. The specificity for all five human activities is more than 94%. The F-measure value for sitting and walking activity is 84.4% and 83.4%, respectively, while the value for value is more than 90% for the rest of the three activities. The average Cohen's Kappa coefficient for all five human activities is 0.865%.
When we compare the values of all the six performance parameters, it is observed that the SVM algorithm provides the best results as compared to the other two classification techniques. All the values of the six performance metrics considering five human activities are more than 90%, except for of walking, which is 84.1%. As far as the KNN and RF classifiers are concerned, there are multiple instances where the values of the performance metrics are below 90%.

Conclusions
This paper presented an automatic method for healthcare applications in IoTs that continuously monitors a patient's different activities and reports sleep episodes due to narcolepsy. The method leveraged S-band sensing technique is used to record variances of wireless channel information. We examined the variances of amplitude and calibrated phase information of CI data and observed that each human activity induced a particular CI registration. Three classification algorithms such as SVM, KNN, and RF algorithms were used to classify different human activities and identify sleep episodes. It was observed that the SVM classifier provided better results than KNN and RF classifiers by examining the six performance metrics. The proposed method is easily deployable and cost-effective. A musical beat alarm helps the patient in waking up and restoring routine activities.