<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Sleep Apnea Detection in Fog Based Ambient Assisted Living System</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ace Dimitrievski</string-name>
          <email>ace.dimitrievski@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Natasa Koceska</string-name>
          <email>natasa.koceska@ugd.edu.mk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eftim Zdravevski</string-name>
          <email>eftim.zdravevski@finki.ukim.mk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Petre Lameski</string-name>
          <email>petre.lameski@finki.ukim.mk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Betim Cico</string-name>
          <email>bcico@umt.edu.al</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Saso Koceski</string-name>
          <email>saso.koceski@ugd.edu.mk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vladimir Trajkovik</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Computer Science and Engineering, Ss.Cyril and Methodius University</institution>
          ,
          <addr-line>Skopje, N.</addr-line>
          <country country="MK">Macedonia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Faculty of Computer Science, University Goce Delcev Stip</institution>
          ,
          <addr-line>N.</addr-line>
          <country country="MK">Macedonia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>MetropolitanTirana University</institution>
          ,
          <addr-line>Tirana</addr-line>
          ,
          <country country="AL">Albania</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Ambient Assisted Living environments use different sensors and actuators to enable their endusers to live in their preferred environments. Unlike smart homes, where a target audience is usually a family unit, standard Ambient Assisted Living end users are care receivers and care providers. This article describes an approach based on the fog computing paradigm to detect sleep apnea in an Ambient Assisted Living context unobtrusively. The edge nodes process and detect local activities of daily living events and have direct control of the local environment. The fog nodes are used to further process and transmit data. The cloud is used for more complex and anonymous data computation. This research shows that sensors, which are unobtrusive and do not interfere with users' daily routines, can be successfully used for pattern observation.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Ambient Assisted Living (AAL)</kwd>
        <kwd>Fog computing</kwd>
        <kwd>Cloud computing</kwd>
        <kwd>Personal health care</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Advancements in cloud computing and the
Internet of Things (IoT) have had a positive
impact on pervasive computing and can
improve Ambient Assisted Living (AAL)
solutions. Fog computing is a newer discipline
that brings an opportunity to fill in some gaps
and improve many aspects of cloud-based AAL
systems, mainly by increasing user privacy if
used correctly [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        Technology for monitoring, assisting, and
improving personal health has improved
considerably with affordable wearable and
unobtrusive sensors, cloud computing, and
improved Internet connectivity. The presence
and rapid growth of the Internet of Things (IoT)
paradigm has also impacted how people
monitor their health. Most current wearable
devices can monitor heart rate and physical
activity. More appliances come with Internet
connection capability, and smart sensors are
becoming increasingly common. The data
obtained with unobtrusive sensing can give a
more detailed picture of the care receivers'
health and personal habits. In that way,
technology directly impacts elderly and
disabled people’s ability to remain at home and
live more independent lives [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ][
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. AAL is also
addressing the growing cost of traditional
health care. Advances in AAL's research
provide tools and methods for improving the
health of the elderly and people with
disabilities. On the other hand, Enhanced
Living Environment (ELE) is a field that
provides resources for personal health for the
general population. Although AAL and ELE
address different target audiences, both fields
benefit from similar technology [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        A typical AAL goal is to enable care
providers to have technology-enabled
continuous monitoring of care receivers. It
reduces care costs on the one hand and
increases care efficiency on the other hand
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ][
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Cloud paradigm fits well for this
scenario as data can be aggregated and analyzed
in a centralized location. An interface for care
providers can be provided from the cloud using
the web and mobile devices. Network reliability
and demand for real-time processing of risk
factors and different privacy concerns require
some local data processing. Fog computing
addresses these problems by its definition.
      </p>
      <p>
        A single device, individual, or group of
unobtrusive sensors present in the ELE can
provide input on a limited set of health aspects.
Smartwatches and health trackers can track
body temperature, heart rate, walking or
running; environmental sensors can detect
temperature, humidity, fall detection, and
movement within the home. A more holistic
picture of these devices and sensors can be
provided if connected to the cloud, where all the
data is analyzed for more robust data processing
techniques. By using data from many users,
machine learning (ML) algorithms can learn
and predict health hazards and find correlations
between the environment and human health
[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ][
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        While IoT cloud-based computing benefits
are visible both in research and daily use, there
are many drawbacks when it comes to personal
health care data clouds. The most significant
ones are the following:
• The lack of security of IoT devices and
companies' un-proper practices that gather
and abuse personal data have made
consumers more proactive in protecting
their data [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. There is a potential of
targeted advertisement to identify personal
health details, with a possibility that future
employers could refuse potential employees
because of their health risks or personal
habits. Insurance companies can purchase
personal data and use it to deny coverage or
increase premiums. Protections against
these practices vary and can be loose in
some jurisdictions. Even when such
protections exist, the legal expenses can be
high, and the case can be challenging to
prove. Fog computing can have a role in data
protection by moving some data analysis to
the edge nodes and anonymizing the cloud's
data.
• Personal healthcare and AAL systems
can generate a significant quantity of data
[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Some ALE scenarios, such as fall
detection, require having an immediate
reaction of the system by triggering an alarm
to the care provider. Data pre-processing on
edge nodes can significantly reduce the
bandwidth requirement and the need for
real-time cloud communication.
• Cloud downtime or connectivity issues
can be a problem in the case of AAL [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
While many large cloud providers have
multiple availability zones, the cost of
having high availability of the cloud is
higher. Edge nodes can more easily be
clustered, allowing for the high availability
of fog computing.
      </p>
      <p>In this paper, we identify multiple benefits
of fog computing in the typical AAL scenario
and propose an architecture that would make
them possible. The AAL fog-based architecture
is described in Section 2 of this paper. The
proposed architecture benefits are illustrated
with the experiment presented in Section 3, and
Section 4 concludes the paper.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Fog based AAL architecture</title>
      <p>
        Fog computing adds a layer to the cloud
computing architecture. However, it should not
be interpreted as an extension of the cloud. Fog
computing spans to adjacent physical locations.
It supports online analytics and various
communications networks in performing
distributed computing [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. There are four
logical layers of Fog computing.
      </p>
      <p>Data is generated by sensors that can be
wearable or body sensors and peripheral or
environmental sensors on the first layer. Data
can also be generated from external sources
such are: social networks, clinical center
information systems, or medical databases.
Data collected by the sensors can include vital
signs, personal habits, or environmental factors.
External data sources can provide different
information, including medical check results,
medical databases for diagnostics, and similar.</p>
      <p>The fog layer gathers the sensor data,
processes them, and passes either processed or
portions of raw data to the cloud. The devices
directly connected to the sensors are called edge
nodes. Aside from collecting data, they can take
action with the user. Each LAN environment
can have one or more edge nodes, depending on
the application requirements and scale. In
elderly care facilities, data for multiple tenants
could be processed on the same edge nodes.
These actions can include providing feedback
to the person to take their medicine or to start
exercising. They can directly interact with the
environment, such as: activating the humidifier
or regulating the room temperature, controlling
electrical appliances, and cutting-off for water,
gas, and electricity in case of an emergency.
The fog network usually has a more limited
capacity than the cloud for data computation
and cannot do complex machine learning and
feature extraction.</p>
      <p>However, fog nodes could be able to run
algorithms developed by machine learning. As
the machine learning system improved and
evolved, regular updates could be pushed down
to the fog network to improve sensor data
patterns. Using this methodology, ADL
detecting ML could receive continuous data
and improve the detection rate. Events that take
a brief time, such as when a person falls, can be
detected by the fog nodes using the latest ML
model improved in the cloud.</p>
      <p>
        The cloud layer assembles and processes the
data from multiple sources and creates machine
learning models. The feature extraction is done
at this layer as well. Data from the fog and
external sources is collected and processed by
the data fusion component [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. The output is
an improved knowledge base. The service layer
uses this knowledge base in turn.
      </p>
      <p>The service layer is the product of the
system. Knowledge obtained by analyzing the
data is used for services, including creating
customized recommendations for diet and
exercise, improving diagnostics systems,
providing updates to the health providers, and
adding additional information in medical
databases.</p>
      <p>
        The critical features that should be satisfied
by the system include security, privacy, high
availability, and interoperability. Security and
privacy [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] can be addressed by implementing
best practices to protect the network and the
data. Redundancy and automatic fail-over are
needed to provide high availability, primarily
when the health care recipient’s life depends on
the assisted living system. The increased
complexity requires ensuring connected and
inter-operable components by using
frameworks intended to ensure mutual
compatibility [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
      </p>
      <p>
        In fog computing, the nodes nearest to the
devices are named edge nodes. In healthcare
systems, these nodes represent smart e-health
gateways. They act as a bridge for medical
sensors to cloud computing platforms. The
main requirement of a gateway is to support
various wireless protocols and inter-device
communication. Its role can be extended to
support several features such as acting as a
repository to temporarily store sensors’ and
users’ information and bring intelligence by
enhancing data fusion, aggregation, and
interpretation techniques. It is essential to
provide preliminary local processing of sensors'
data, which is the primary role of a smart
ehealth gateway. Smart e-health gateway can
tackle many challenges in ubiquitous healthcare
systems such as energy efficiency, scalability,
interoperability, and reliability issues [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].
      </p>
      <p>Due to the privacy concerns and the
technical aspects for scalability and
interoperability, it is crucial to identify and
trace the data flow in the system. Sensor data
originates when sensors acquire measurement
from the physical world. This measurement is
represented by an electrical signal transferred to
a controller that would interpret the signal.
Some sensors are manufactured to include the
electronic circuits to digitalize the reading, and
some are even Internet-connected, enabling
them to upload the data to a remote system
directly. The sensor data is then passed to the
local processing nodes. These nodes are part of
the fog and can communicate to other layers of
the fog. The data on these edge nodes is
processed for local events detection.</p>
      <p>
        Only the edge nodes or smart e-health
gateways should be able to get unfiltered raw
sensor data. The data that is passed on to other
layers of the fog is pre-processed [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. From
this point, the data can be split into multiple
processing paths depending on the desired
function. Data with person-identifying
properties can only be passed to the fog areas
used for healthcare provider usage in a
compliant way with local regulations for
handling medical data. Data used for science
research can also contain medical data, but
personal identifiers should be stripped or
hashed. Other service types might require
aggregated data that does not expose the user’s
medical conditions. It, for example, can include
the average time spent outdoors. Such data can
be correlated with local weather to determine
the best time to organize group activities for the
community's senior members. Some data might
be of the type that the person would like to share
on social media or other platforms. It might
include exercise data such as walking, hiking,
or riding a bike.
      </p>
      <p>Each of the services dealing with user data
is logically independent and can be hosted on
separate cloud platforms. The health provider
service is independent of social media or
medical research databases. The separation of
the cloud can be implemented by separation on
any level in the fog network. As the data is
passed between layers of the fog network,
several processing types can occur. Data
processing tasks mostly would take place on the
edge nodes or smart e-health gateways as the
gateways would directly interface with the
sensor network and receive raw sensor data. At
this layer, we can identify the following types
of tasks:</p>
      <p>
        Data filtering is used to filter noise, invalid
sensor readings, and redundant information that
does not contribute to the desired information
the system should induce. Sensor data contains
valuable information. However, they also carry
non-deterministic errors such as motion
artifacts, data corruption issues, and unwanted
signals that are also significantly uploaded to
increasing storage requirements and power
consumption. Fog computing could play an
essential role in increasing efficiency and
reduce storage requirements for medical big
data solutions [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ].
      </p>
      <p>Anonymizing of data strips or replacing
person-identifying information from data
packets. When there is a requirement to
separate patient/customer data, personal
information is replaced with unique identifiers.
This data can be passed on to the fog nodes for
added security using an enterprise service bus
(ESB).</p>
      <p>
        Data fusion automatically transforms
information from different sources and points
into a representation that provides practical
support for automated decision-making.
Applying data fusion in gateways provides
several advantages: reduced data ambiguity,
extended coverage in space and time,
robustness and reliability, and increased data
quality. After data is fused, only final results are
transmitted through the network so the network
bandwidth can be efficiently utilized, and the
system can be more energy-efficient [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
      </p>
      <p>
        Data processing that can be done on any
layer of the fog network includes:
• Data compression is used to reduce the
amount of bandwidth required to transmit
the sensor network's information.
Compression can be lossy or lossless. Lossy
compression can be acceptable in many
cases, especially if the sensor data's
resolution is too high. Besides, the extra
information will not cause significant
improvements in the algorithms [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
• Data encryption is used to protect data
as it passes through the network. Data
encryption can be full or partial. For
example, a gateway node would encrypt
sensor readings and meta-data of the person.
However, the personal information would
be encrypted so that only the healthcare
provider’s network would have the
decryption key. The sensor data would be
encrypted so the fog nodes would decrypt
and, without person-identifying meta-data,
pass it onto cloud instances to do statistical
analysis or machine learning. This method
will reduce data duplication in the network
as the same information will not have to be
transmitted twice from the gateway to
different fog nodes.
• Error code correction can be used to
ensure validity during transmission. The fog
network can rely on various data
transmission techniques and technologies to
pass on the information; sometimes, the
network protocol would have a built-in
feature to ensure valid transmission. When
this is not the case, the fog nodes would have
to ensure the data's validity by identifying
and correcting transmission errors. The
same applies to the data traveling from the
sensors to the gateway, as many sensors do
not have a buffer memory and cannot
retransmit data. Error code correction will be
used to identify faulty readings and discard
them (because having gaps in the data is
often better than having inaccurate data).
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Experiment</title>
      <p>A common usage of sensor networks is to
train machine learning models and enable
different end-user actions. Depending on the
number of sensors used, the number of features
extracted from the sensor data, and the data
generation rate, generating the model will most
likely be done in the cloud due to the resources
demand and a potential need to use data from
other locations. On the other hand, the
implementation of the model can and should be
done on edge. As an example, we will consider
a data flow model to detect sleep apnea using
noninvasive sensors, illustrated in Figure 1.</p>
      <p>The strong correlation between the two
sensor types, shown in the diagram of recorded
sensor data over 8 hours, is presented in Figure
4.</p>
      <p>
        When motion is detected, the data from
multiple noninvasive sensors is processed on
the edge node. The local machine learning
model is run, and the possible occurrence of
sleep apnea is diagnosed. Periodical sessions
with invasive sensors or medical professionals'
observations can be carried out to label the data
set [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ].
      </p>
      <p>After anonymization of the data, it is
packaged and sent to the cloud for additional
processing. The data model on the cloud side is
run to verify the outcome for the received data.
If the model present in the cloud makes positive
detection for the received data and if the data
was previously labeled with a negative result by
the edge node, then the updated model is sent
back to the edge node, which in turn processes
the data against the updated model.</p>
      <p>Sensor data that does not suggest strong
negative results are marked for further labeling
if additional data such as monitoring from
medical equipment or video that can be
analyzed by a trained professional is available.
Such feedback is periodically included to build
the cloud model continuously.
3.1.</p>
    </sec>
    <sec id="sec-4">
      <title>Classification algorithms</title>
      <p>
        This section explains the classification
algorithms used for feature ranking and
construction classification models. The
accuracy was used for the comparison of
various classification models throughout the
system. One of the classification algorithms
used in our experiments is logistic regression
[
        <xref ref-type="bibr" rid="ref23">23</xref>
        ]. For small datasets, it is straightforward
and provides easily interpretable models.
Moreover, it is a lightweight algorithm, which
can be useful if the system is deployed on
hardware with limited resources.
      </p>
      <p>
        Random Forest (RF) [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ] is an effective
algorithm that creates an ensemble of decision
trees [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] by randomly sampling training
instances from the dataset. The sampling is
random but consistent while growing a single
tree. The multiple decision trees are trained on
the training data independently.
      </p>
      <p>
        The tree branching is performed by finding
the best split from the features on each node.
During classification, trees vote for the class,
and the majority class is eventually predicted.
Like RF, the Extremely Randomized Trees
(ERT) algorithm [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] also generates trees'
ensembles. ERT chooses the split from the
attributes randomly, unlike RF. As a result, the
number of calculations per node is decreased,
thus increasing the training speed. Both
algorithms provide excellent classification
performance and can train models on extensive
datasets very fast.
      </p>
      <p>Both ERT and RF provide feature
importance estimates, a property used for
feature ranking and discarding of
lowimportance features during the feature selection
phase. We have used the feature importance
estimates when training an ERT classifier due
to its better speed than RF.</p>
      <p>
        Additionally, we have also used the Support
Vector Machines (SVM) classifier [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] with
Gaussian kernel. Even though SVMs are much
slower algorithms as the dimensionality of data
increases, they are compelling, especially after
parameter tuning [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ]. Whenever we used
SVMs, the datasets were normalized so that the
training dataset will have a mean and standard
deviation of 0 and 1, respectively. The RF and
ERT parameters were the default per their
implementation in the [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ] library. We did not
notice any significant gain by tuning their
parameters (i.e., number of features per tree).
Both ERT and RF classifiers were trained using
100 trees, which was appropriate for this size
dataset. Using fewer trees improved the speed
while offering slightly worse classification
performance. This library was used for the other
classification algorithms as well.
3.2.
      </p>
    </sec>
    <sec id="sec-5">
      <title>Feature extraction</title>
      <p>The measurements from sensors can detect
atomic actions or states. More complex actions
are depending on the context, which recent
measurements can determine. Therefore, the
data needs to be first adequately segmented, and
then feature extraction performed [30]. This
study additionally discusses the window size
impact on activity recognition. Generally,
lower sensor frequencies entail longer
windows. It is considered during our
experiments by using different window lengths
and analyzing the accuracy depending on them.
The segmentation into windows, step 1 on
Figure 5, was performed, thus excluding the
border intervals when the activity changes from
one activity to another.</p>
      <p>Segmenting of streaming data into windows
is performed in step 2 in Figure 5. Step 2
extracts the following types of features (the
number of measurements within one window is
denoted by n.):
• Basic statistics results in 14 features
per time series.
• Equal-width histogram calculated with
[log! +1] intervals, based on the Sturges
rule [31]. It results in 5 to 8 features when
the window length varies from 5s (25
measurements) to 20s (100 measurements).
• Quantile-based features: first quartile,
median, third quartile, interquartile ranges,
and other percentiles (5, 10, 20, 30, 40, 60,
70, 80, 90, 95), also used in [32]. From
onetime series, it generates 14 features.
• Auto-correlation of the measurements
within one sliding window [33]. Let τ denote
the amount of shift, and its domain is
defined as τ ∈ [1, ë n û]
• For exponentially increasing values of
τ in that range, classical autocorrelation and
Pearson correlation are calculated.
Additionally, it calculates both correlations
using the first and second half of
measurements within one sliding window.
This results in 3 to 4 τ values when the
window length varies from 5s (25
measurements) to 20s (100 measurements).
• Pearson correlations between pairs of
time series; For five-time series, this results
in 9 features.
• Linear and quadratic fit coefficients;
There are two linear fit and three quadratic
fit coefficients, yielding five features in total
per time series.
• As a result of step 2, 250 to 270 features
are generated depending on the window
length. In step 3 performs feature
importance and drift sensitivity estimation is
done. Next, step 4 performs coarse-grained
feature selection, which tests a set of
thresholds used to discard features with low
importance or high drift sensitivity.</p>
      <p>The system evaluates different feature sets
by building classification models using the
training dataset and evaluating them with the
validation dataset. The test set is not utilized at
this stage at all. Thus, only the feature set that
results in the best classification accuracy is
retained. To summarize, the purpose of this step
is to significantly reduce the feature set size by
discarding features with low importance or high
data drift sensitivity.</p>
      <p>The system evaluates different feature sets
by building classification models using the
training dataset and evaluating them with the
validation dataset. The test set is not utilized at
this stage at all. Thus, only the feature set that
results in the best classification accuracy is
retained. To summarize, the purpose of this step
is to significantly reduce the feature set size by
discarding features with low importance or high
data drift sensitivity.</p>
      <p>After the feature set is reduced, step 5 uses
the training and validation sets to perform
parameter tuning for the SVM.</p>
      <p>Finally, step 6 evaluates different classifiers
by building classification models with the
training and validation dataset's union and
evaluating it using the independent test set.</p>
    </sec>
    <sec id="sec-6">
      <title>4. Results and evaluation</title>
      <p>The duration of our experiment was 8 hours.
The sampling rate was set to 10Hz, thereby
measuring ten values from each sensor every
second. We divided the dataset into three
different subsets: training, validation, and
testing. The training subset consisted of the first
45% records for each action, and the validation
subset consisted of the next 25% records. The
remaining 30% of records belonged to the test
subset. When performing parameter tuning for
SVMs and making feature selection, the
training set was used to build models, and the
validation set was used to evaluate their
performance. Once this phase was completed,
the final evaluation was performed only with
the best feature set decided after the feature
screening and using the most optimal
parameters. The union of the training and
validation sets was used to build classification
models for making final predictions. The test
set was used for building predictions and the
performance evaluation.</p>
    </sec>
    <sec id="sec-7">
      <title>5. Conclusion</title>
      <p>As personal health becomes pervasive and
the data generated by it increases in volume, fog
computing offers a solution for many critical
challenges. The added flexibility of the fog
architecture enables better placement of
computing and network resources. Smarter data
flow could protect personal data, bandwidth
cost could be reduced, and more scalable,
secure, and interoperable systems can be
designed. This paper illustrates those benefits
by providing an experimental illustration of
typical AAL service provided by fog-based
health care ELE.</p>
      <p>By using simple hardware, the AAL data
was streamed to a cloud-based system, where it
was fused. Using a systematic and automated
feature extraction and selection process, we
could extract robust and reliable features that
facilitated building powerful classification
models.</p>
    </sec>
    <sec id="sec-8">
      <title>6. Acknowledgements</title>
      <p>This work was partially financed by the
Faculty of Computer Science and Engineering
at the Ss. Cyril and Methodius University,
Skopje, Macedonia and is supported by the
networking activities provided by the ICT
COST Actions IC1303 AAPELE and CA16226
SHELD-ON.</p>
      <p>We also acknowledge Microsoft Azure's
support for research through a grant providing
computational resources for this work.</p>
    </sec>
    <sec id="sec-9">
      <title>7. References</title>
      <p>Learning Research, vol. 12, 2011, pp.
2825–2830.
[30] O. Banos, et al., “Window size impact in
human activity recognition,” Sensors, vol.
14, no. 4, 2014. DOI:
10.3390/s140406474, pp. 6474–6499.
[31] H. A. Sturges, “The choice of a class
interval,” Journal of the American
Statistical Association, vol. 21, no. 153,
1926, pp. 65–66.
[32] P. Siirtola and J. R¨oning, “Recognizing
human activities user independently on
smartphones based on accelerometer
data,” International Journal of Artificial
Intelligence and Interactive Multimedia,
vol. 1, no. 5, 2012, pp. 38–45.
[33] H. Mart´ın, A. M. Bernardos, J. Iglesias,
and J. R. Casar, “Activity logging using
lightweight classification techniques in
mobile devices,” Personal and Ubiquitous
Computing, vol. 17, no. 4, 2013. doi:
10.1007/s00779-012-0515-4, pp. 675–
695.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Aazam</surname>
          </string-name>
          and
          <string-name>
            <given-names>E.-N.</given-names>
            <surname>Huh</surname>
          </string-name>
          , “
          <article-title>Fog computing and smart gateway based communication for cloud of things,” in Future Internet of Things and Cloud (FiCloud</article-title>
          ),
          <source>2014 International Conference on. IEEE</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>464</fpage>
          -
          <lpage>470</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>T. N.</given-names>
            <surname>Gia</surname>
          </string-name>
          , et al., “
          <article-title>Fog computing in health- care internet of things: A case study on ECG feature extraction</article-title>
          ,” in
          <source>Computer and Information Technology; Ubiquitous Computing and Communications; Dependable, Autonomic and Secure Computing; Pervasive Intelligence and Computing</source>
          (CIT/IUCC/DASC/PICOM),
          <source>2015 IEEE International Conference on. IEEE</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>356</fpage>
          -
          <lpage>363</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>V.</given-names>
            <surname>Stantchev</surname>
          </string-name>
          , et al., “
          <article-title>Smart items, fog and cloud computing as enablers of servitization in healthcare,”</article-title>
          <source>Sensors &amp; Transducers</source>
          , vol.
          <volume>185</volume>
          , no.
          <issue>2</issue>
          , p.
          <fpage>121</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>P.</given-names>
            <surname>Maresova</surname>
          </string-name>
          , et al.,
          <article-title>"Technological Solutions for Older People with Alzheimer's Disease"</article-title>
          <source>Current Alzheimer Research</source>
          , Volume
          <volume>15</volume>
          , No. 9
          <source>April</source>
          <year>2018</year>
          , DOI:10.2174/1567205015666180427124 547, pp.
          <fpage>975</fpage>
          -
          <lpage>983</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Goleva</surname>
          </string-name>
          , et al.,, “AAL and
          <string-name>
            <surname>ELE Platform</surname>
          </string-name>
          <article-title>Architecture” in book: Ambient Assisted Living and Enhanced Living Environments: Principles, Technologies</article-title>
          and Control, ,
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>L.</given-names>
            <surname>Gu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Zeng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Barnawi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Xiang</surname>
          </string-name>
          , “
          <article-title>Cost-efficient resource management in fog computing supported medical cyber-physical system</article-title>
          ,
          <source>” IEEE Transactions on Emerging Topics in Computing</source>
          , vol.
          <volume>5</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>108</fpage>
          -
          <lpage>119</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>O.</given-names>
            <surname>Kotevska</surname>
          </string-name>
          , et al.
          <article-title>"Towards a PatientCentered Collaborative Health Care System Model,"</article-title>
          <source>International Journal of Computer Theory and Engineering</source>
          , vol.
          <volume>4</volume>
          , no.
          <issue>6</issue>
          ,
          <string-name>
            <surname>November</surname>
            <given-names>2012</given-names>
          </string-name>
          , DOI: 10.7763/IJCTE.
          <year>2012</year>
          .V4.631, pp.
          <fpage>1025</fpage>
          -
          <lpage>1029</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>L.</given-names>
            <surname>Xu</surname>
          </string-name>
          , et al.
          <article-title>"What Clinics Are Expecting From Data Scientists? A Review on DataOriented Studies Through Qualitative and Quantitative Approaches."</article-title>
          <source>In IEEE Access</source>
          , Volume
          <volume>7</volume>
          ,
          <issue>January2019</issue>
          ,
          <source>DOI:10.1109/ACCESS.201 8</source>
          .2885586, pp.
          <fpage>641</fpage>
          -
          <lpage>654</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>I.</given-names>
            <surname>Kulev</surname>
          </string-name>
          , et al. “
          <article-title>Recommendation Algorithm Based on Collaborative Filtering and its Application in Healthcare”</article-title>
          ,
          <source>The 10th Conference for Informatics and Information Technology (CIIT</source>
          <year>2013</year>
          ), Bitola,
          <string-name>
            <given-names>R.</given-names>
            <surname>Macedonia</surname>
          </string-name>
          ,
          <source>April 18-21</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>M.</given-names>
            <surname>Barhamgi</surname>
          </string-name>
          , et al., “
          <article-title>Enabling end-users to protect their privacy</article-title>
          ,
          <source>” in Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security. ACM</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>905</fpage>
          -
          <lpage>907</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>E.</given-names>
            <surname>Vlahu-Gjorgievska</surname>
          </string-name>
          , et al.,
          <article-title>"ConnectedHealth Algorithm: Development and Evaluation."</article-title>
          <source>Journal of Medical Systems</source>
          , vol.
          <volume>40</volume>
          , no.
          <issue>4</issue>
          ,
          <year>2016</year>
          , DOI: 10.1007/s10916-016
          <source>-0466-9</source>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>A. M. Rahmani</surname>
          </string-name>
          , et al., “
          <article-title>Exploiting smart e-health gateways at the edge of healthcare internet-of-things: a fog computing approach,” Future Generation Computer Systems</article-title>
          , vol.
          <volume>78</volume>
          , pp.
          <fpage>641</fpage>
          -
          <lpage>658</lpage>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Shi</surname>
          </string-name>
          , et al., “
          <article-title>The fog computing service for healthcare,” in Future Information and Communication Technologies for Ubiquitous HealthCare</article-title>
          (
          <string-name>
            <surname>Ubi-HealthTech)</surname>
          </string-name>
          ,
          <source>2015 2nd International Symposium on. IEEE</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>A.</given-names>
            <surname>Zdravevska</surname>
          </string-name>
          , et al, “
          <article-title>Cloud-based recognition of complex activities for ambient assisted living in smart homes with noninvasive sensors,” in Smart Technologies</article-title>
          ,
          <source>IEEE EUROCON 2017- 17th International Conference on. IEEE</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>769</fpage>
          -
          <lpage>774</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>A.</given-names>
            <surname>Alrawais</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Alhothaily</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Hu</surname>
          </string-name>
          , and X. Cheng, “
          <article-title>Fog computing for the internet of things: Security and privacy issues,” IEEE Internet Computing</article-title>
          , vol.
          <volume>21</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>34</fpage>
          -
          <lpage>42</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>M.</given-names>
            <surname>Memon</surname>
          </string-name>
          , et al, “
          <article-title>Ambient assisted living healthcare frameworks, platforms, standards</article-title>
          , and quality attributes,
          <source>” Sensors</source>
          , vol.
          <volume>14</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>4312</fpage>
          -
          <lpage>4341</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>A.M. Rahmani</surname>
          </string-name>
          , et al, “
          <article-title>Smart e-health gateway: Bringing intelligence to internetof-things based ubiquitous healthcare systems</article-title>
          ,” in
          <source>Consumer Communications and Networking Conference (CCNC)</source>
          ,
          <year>2015</year>
          12th
          <string-name>
            <given-names>Annual</given-names>
            <surname>IEEE. IEEE</surname>
          </string-name>
          ,
          <year>2015</year>
          , pp.
          <fpage>826</fpage>
          -
          <lpage>834</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>A.</given-names>
            <surname>Atanasov</surname>
          </string-name>
          , et al. “
          <article-title>Testbed Environment for Wireless Sensor and Actuator Network”</article-title>
          ,
          <source>in Proc of the 5th International Conference on Systems and Network Communications - ICSNC</source>
          <year>2010</year>
          ,
          <article-title>CD publication</article-title>
          , Nice, France,
          <year>August 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>H.</given-names>
            <surname>Dubey</surname>
          </string-name>
          , et al, “
          <article-title>Fog data: Enhancing telehealth big data through fog computing,” in Proceedings of the ASE BigData</article-title>
          &amp;
          <article-title>SocialInformatics 2015</article-title>
          . ACM,
          <year>2015</year>
          , p.
          <fpage>14</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>E.</given-names>
            <surname>Zdravevski</surname>
          </string-name>
          , et al.
          <article-title>Improving activity recognition accuracy in ambient-assisted living systems by automated feature engineering</article-title>
          .
          <source>IEEE Access</source>
          ,
          <volume>5</volume>
          ,
          <year>2017</year>
          , pp.
          <fpage>5262</fpage>
          -
          <lpage>5280</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>V. K.</given-names>
            <surname>Somers</surname>
          </string-name>
          , et al.,“
          <article-title>Sympathetic neural mechanisms in obstructive sleep apnea</article-title>
          .
          <source>” Journal of Clinical Investigation</source>
          , vol.
          <volume>96</volume>
          , no.
          <issue>4</issue>
          ,
          <issue>1995</issue>
          , p.
          <year>1897</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <surname>J.-C. Vazquez</surname>
          </string-name>
          , et al., “
          <article-title>Automated analysis of digital oximetry in the diagnosis of obstructive sleep apnoea</article-title>
          ,
          <source>” Thorax</source>
          , vol.
          <volume>55</volume>
          , no.
          <issue>4</issue>
          ,
          <issue>2000</issue>
          , pp.
          <fpage>302</fpage>
          -
          <lpage>307</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>D. W. Hosmer</given-names>
            <surname>Jr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lemeshow</surname>
          </string-name>
          , and
          <string-name>
            <given-names>R. X.</given-names>
            <surname>Sturdivant</surname>
          </string-name>
          , Applied logistic regression. John Wiley &amp; Sons,
          <year>2013</year>
          , vol.
          <volume>398</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>L.</given-names>
            <surname>Breiman</surname>
          </string-name>
          , “Random forests,
          <source>” Machine Learning</source>
          , vol.
          <volume>45</volume>
          , no.
          <issue>1</issue>
          ,
          <year>2001</year>
          , DOI: 10.1023/A:1010933404324, pp.
          <fpage>5</fpage>
          -
          <lpage>32</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Quinlan</surname>
          </string-name>
          , “
          <article-title>Induction of decision trees,” Machine learning</article-title>
          , vol.
          <volume>1</volume>
          , no.
          <issue>1</issue>
          ,
          <issue>1986</issue>
          , pp.
          <fpage>81</fpage>
          -
          <lpage>106</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>P.</given-names>
            <surname>Geurts</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ernst</surname>
          </string-name>
          , and L. Wehenkel, “
          <article-title>Extremely randomized trees</article-title>
          ,
          <source>” Machine learning</source>
          , vol.
          <volume>63</volume>
          , no.
          <issue>1</issue>
          ,
          <issue>2006</issue>
          , pp.
          <fpage>3</fpage>
          -
          <lpage>42</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>C.</given-names>
            <surname>Cortes</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Vapnik</surname>
          </string-name>
          , “
          <article-title>Support-vector networks</article-title>
          ,
          <source>” Machine Learning</source>
          , vol.
          <volume>20</volume>
          , no.
          <issue>3</issue>
          ,
          <year>1995</year>
          . DOI:
          <volume>10</volume>
          .1007/BF00994018, pp.
          <fpage>273</fpage>
          -
          <lpage>297</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          [28]
          <string-name>
            <given-names>P.</given-names>
            <surname>Lameski</surname>
          </string-name>
          , E. Zdravevski,
          <string-name>
            <given-names>R.</given-names>
            <surname>Mingo</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Kulakov</surname>
          </string-name>
          , “
          <article-title>Svm parameter tuning with grid search and its impact on reduction of model overfitting,” in Rough Sets, Fuzzy Sets</article-title>
          ,
          <source>Data Mining, and Granular Computing</source>
          . Springer,
          <year>2015</year>
          , pp.
          <fpage>464</fpage>
          -
          <lpage>474</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          [29]
          <string-name>
            <given-names>F.</given-names>
            <surname>Pedregosa</surname>
          </string-name>
          , et al.,
          <source>“Scikit-learn: Machine learning in Python,” Journal of Machine</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>