[acronym]long-short acronymnohyperfirsttrue

# Meta-Decomposition: Dynamic Segmentation Approach Selection in IoT-based
Activity Recognition

Seyed M.R. Modaresi
LIPN-UMR-CNRS 7030,
Sorbonne University Paris Nord,
Paris, France
<EMAIL_ADDRESS>
&Aomar Osmani
LIPN-UMR-CNRS 7030,
Sorbonne University Paris Nord,
Paris, France
<EMAIL_ADDRESS>
&Mohammadreza Razzazi
Computer Engineering Department,
Amirkabir University of Technology,
Tehran, Iran
<EMAIL_ADDRESS>
Abdelghani Chibani
Laboratory of Images, Signals and Intelligent Systems
Université Paris-Est Créteil,
Paris, France
<EMAIL_ADDRESS>
###### Abstract

Internet of Things (IoT) devices generate heterogeneous data over time; and
relying solely on individual data points is inadequate for accurate analysis.
Segmentation is a common preprocessing step in many IoT applications,
including IoT-based activity recognition, aiming to address the limitations of
individual events and streamline the process. However, this step introduces at
least two families of uncontrollable biases. The first is caused by the
changes made by the segmentation process on the initial problem space, such as
dividing the input data into 60 seconds windows. The second category of biases
results from the segmentation process itself, including the fixation of the
segmentation method and its parameters. To address these biases, we propose to
redefine the segmentation problem as a special case of a decomposition
problem, including three key components: a decomposer, resolutions, and a
composer. The inclusion of the composer task in the segmentation process
facilitates an assessment of the relationship between the original problem and
the problem after the segmentation. Therefore, It leads to an improvement in
the evaluation process and, consequently, in the selection of the appropriate
segmentation method. Then, we formally introduce our novel meta-decomposition
or learning-to-decompose approach. It reduces the segmentation biases by
considering the segmentation as a hyperparameter to be optimized by the outer
learning problem. Therefore, meta-decomposition improves the overall system
performance by dynamically selecting the appropriate segmentation method
without including the mentioned biases. Extensive experiments on four real-
world datasets demonstrate the effectiveness of our proposal.

_Keywords_ Internet of Things $\cdot$ IoT $\cdot$ Activity Recognition $\cdot$
Segmentation

##  1 Introduction

We are moving towards the Internet of Things (IoT), and the number of deployed
sensors is rapidly increasing. These sensors collect uni-modal or multi-modal
observation data such as temperature sensor, door sensor, optical sensor
(Kumar et al., 2023; Perera et al., 2014; Messaoud et al., 2020). Recognition
of human activities (HAR ) from IoT data is expected to be the heart of myriad
IoT applications such as healthcare, smart homes, and security (Mocrii et al.,
2018; Qian et al., 2021; Chen et al., 2021; Perera et al., 2014; Kumar et al.,
2023; Messaoud et al., 2020). Particularly, with the growing population of
older adults which is expected to double by 2050, there has been a surge of
interest in sensory and processing data for HAR to support their healthcare
needs (Ariza-Colpas et al., 2022; Sokullu et al., 2020). HAR plays a crucial
role in enabling devices to monitor, analyze, and enhance the daily lives of
humans by recognizing their behaviors (Chen et al., 2021). However, it is
still a challenging task to provide sufficiently robust activity recognition
systems in a real environment due to the complexity and diversity of human
behaviors that vary from person to person (Najeh et al., 2022; Bouchabou et
al., 2021a).

IoT devices generate heterogeneous series of data from sensors located in
physical spaces or carried by people, such as smartwatches (Hu et al., 2017;
Ariza-Colpas et al., 2022; Hu et al., 2019). Unlike transactional data, these
series of data are characterized by their continuous and relative nature,
making them dependent on their previous and subsequent data points (Fu, 2011;
Cook and Narayanan, 2015); Segmentation is a common and essential bias that
partitions this long, potentially infinite data sequence into a set of smaller
and more meaningful finite segments. It overcomes the limitation of a single
sample and provides adequate information about an activity (Chen et al., 2021;
Ni et al., 2015; Demrozi et al., 2021). Segmentation helps to deal with the
complexity of HAR problems, although it directly impacts the recognition
quality (Ni et al., 2015). On one hand, inadequate information in one segment
may cause the activity to be poorly detected; on the other hand, if a segment
contains too much information, extra complexity may be added for future data
processing (Krishnan and Cook, 2014; Ni et al., 2015). Consequently, a trade-
off exists between the sufficiency of information in each segment, minimizing
the number of segments, and reducing the processing complexity of each one to
discover the expected concepts. Additionally, since segmenting data alters
some characteristics of the sensor’s data, it should be carefully considered.

In machine learning, the term “bias” refers to any factor that favors one
generalization over another (Mitchell and Mitchell, 1980; Gordon and
Desjardins, 1995). The segmentation process introduces at least two families
of uncontrollable biases. The first one is introduced to the model due to the
changes in problem space by the segmentation. For instance, a common approach
in HAR consists of segmenting the data and feeding them to the model to
identify the activity in each segment (Cook and Narayanan, 2015). It is often
assumed that the classifier performance over the segments follows the whole
system performance (Qian et al., 2021; Cook and Narayanan, 2015; Bouchabou et
al., 2021a; Perera et al., 2014; Bilen et al., 2020). This hard hypothesis may
misleadingly present convincing results because different segmentation
algorithms generate various kinds of segments with different sizes and
structures. Consequently, the results of those algorithms are in distinct
spaces and cannot be compared directly. This issue is explained in detail in
Section 4.3. Additionally, activities have some time-related properties
(Modaresi et al., 2022) that may be lost due to segmentation. For example,
steady recognition of the sleeping activity is critical; otherwise, it may
incorrectly present a disorder (Alemdar et al., 2015).

The segmentation approach itself is the other bias of the segmentation
process. It is often implicitly incorporated with the prior knowledge or
assumptions originating from the developers, researchers, or experts during
the selection and tuning of the segmentation approach. Accurate recognition of
activities (particularly the complex ones) highly depends on the segmentation
method (Chen et al., 2021; Ni et al., 2015); for instance, by including a bias
to have smaller segments than the required segment size, the machine learning
process may not properly identify the activity. Meta-learning and AutoML
techniques has gained attention in recent years for algorithm and
hyperparameter selection. However, meta-learning requires the availability of
multiple tasks to learn from (Aguiar et al., 2019; Rossi et al., 2021; Huisman
et al., 2021), while it is not the case in a single HAR task, making it
challenging to apply meta-learning approaches that depend on learning from
multiple related tasks. In addition, AutoML techniques do not change the
algorithm dynamically over time (Mu et al., 2022; Taylor et al., 2018). IoT
systems is Dynamic in Nature (Kumar et al., 2023), therefore, it is
unrealistic to assume that individual activities remain unchanged; for
instance, the daily activities in winter are different from those in summer
(Chen et al., 2021). Therefore, an appropriate segmentation approach in one
period may not be efficient for another one.

In this paper, to address these biases in the segmentation preprocessing step
in the HAR system, we first reformulate the segmentation as a decomposition
problem and then introduce our novel meta-decomposition approach to address
these biases. Therefore, the segmentation problem is redefined as a particular
case of data decomposition one that includes the decomposer (traditional
segmentation), the resolutions (ML), and the composer steps. The composer step
transforms the ML results to the global problem results to better describe and
evaluate the impact of the introduced biases in the segmentation process. It
addresses the first family of biases.
To overcome the second family of biases, we propose a novel approach called
meta-decomposition or learning-to-decompose that learns how to decompose the
original task (recognizing activities from long data) into smaller sub-tasks.
Therefore, it can be integrated with meta-learning techniques that require
multiple tasks to improve recognition performance. Meta-decomposition seeks to
reduce the segmentation biases and optimize the overall system performance by
learning how to generate sub-tasks rather than assuming the segmentation
method as pre-specified and fixed. In the proposed model, the segmentation is
an ML hyperparameter that is learned adaptively based on the application and
constraints in the outer learning algorithm to improve the recognition quality
of the inner learning process. As explained before, without considering the
meta-composer part, meta-decomposition introduces an additional bias in the
comparison of different segmentation approaches due to the inconsistency in
the segments. In the experiments, we propose a simple and effective data-
driven approach to demonstrate the feasibility of finding a proper
segmentation method and its hyperparameter in our proposal and show the
superiority of our approach compared to the other approaches with their best
hyperparameters on four public datasets.

The structure of this paper is as follows: Section 2 introduces the
segmentation problem, summarizes existing segmentation approaches, and briefly
discusses meta-learning and AutoML. Section 3 provides a depiction of the
proposed segmentation formulation and the meta-decomposition model. In Section
4, we present the experimental environment, datasets, and our framework, and
demonstrate the effectiveness of the meta-decomposition concept. Finally,
Section 5 presents the conclusions drawn from this study.

##  2 Background and Related Work

In sensor-based HAR, the objective is to identify activities including both
activity class and their temporal duration based on a sequence of input sensor
events (Cook and Narayanan, 2015; Mocrii et al., 2018). The information
provided by a single sensor event is inadequate for identifying a particular
activity. Accordingly, it is crucial to partition sensor events into a
collection of segments that can be mapped to a specific activity (Minh Dang et
al., 2020; Bouchabou et al., 2021a; Demrozi et al., 2021). Segmentation can
significantly affect the system performance because it alters some
characteristics of the underlying data. Thus, a trade-off exists between the
count of segments, the amount of information conveyed by each segment (e.g.,
segment size), and the processing complexity entailed in each segment (Ni et
al., 2015).

Since segmentation can significantly affect the final results, several studies
in HAR mainly work on utilizing pre-segmented sequences (Najeh et al., 2022).
Nevertheless, this approach is not practical in real-world scenarios (Krishnan
and Cook, 2014; De-La-Hoz-Franco et al., 2018; Bouchabou et al., 2021a; Xu et
al., 2020; Cumin et al., 2018). Therefore, some studies rely on a segmentation
approach that is based on temporal information (Bouchabou et al., 2021a; Fu,
2011; Krishnan and Cook, 2014; Ni et al., 2015), similarity or dissimilarity
between segments (Najeh et al., 2022; Yala et al., 2017; Wan et al., 2015;
Sfar and Bouzeghoub, 2018), ontology and domain knowledge (Triboan et al.,
2019; Sfar and Bouzeghoub, 2018; Wang and Miao, 2018; Najeh et al., 2022),
learning the segment size (Krishnan and Cook, 2014; Sfar and Bouzeghoub,
2018), sensor events (Ni et al., 2015; Bouchabou et al., 2021a; Ortiz Laguna
et al., 2011), activity or explicit segments (Ni et al., 2015; Bouchabou et
al., 2021a; Lunardi et al., 2018), gathering sufficient features (Ni et al.,
2015; Krishnan and Cook, 2014; Cook and Narayanan, 2015; Yala et al., 2017;
Sfar and Bouzeghoub, 2018), evolutionary computation (Tak-Chung Fu et al.,
2001), detecting change points (Aminikhanghahi and Cook, 2019; Zameni et al.,
2020), feasible space window (Hu et al., 2017), and hybrid approaches (Najeh
et al., 2022). It has been proved that dynamic segmentation approaches perform
better than static ones (Fu, 2011). However, the aforementioned studies are
designed to be used in a particular application and dataset. e.g., some of
them need continuous senses, meaning that all sensor values must be available
at each time point; others work on sparse sensor streams, where sensor events
are triggered only because of human activities, like motion sensor sequence
(Krishnan and Cook, 2014).

Regarding recent surveys of human activity recognition in smart homes
(Bouchabou et al., 2021a; Ariza-Colpas et al., 2022; Minh Dang et al., 2020;
Wang et al., 2021), the most common approaches for data segmentation are Time
Windows (TW), Event Windows (EW), and Dynamic Windows (DW). Kasteren et. al.
(Kasteren et al., 2011) determined that a time window of 60s in TW provides a
high classification performance for binary sensors, and it has been used as a
reference in several recent works (Bouchabou et al., 2021a; Medina-Quero et
al., 2018; Hamad et al., 2021, 2020). Moreover, for EW that has variable
window duration due to the occurrence of events at various times, a window of
20 to 30 events is commonly selected (Bouchabou et al., 2021a; Aminikhanghahi
and Cook, 2019). However, these parameters are completely dependent on a given
dataset, and the significance of selecting an appropriate one is studied in
(Minh Dang et al., 2020) for window size. Quigley et. al. (Quigley et al.,
2018) demonstrate that although TW reaches a high accuracy, it fails to
properly identify all classes. On the other hand, DW uses a non-fixed window
size and tries to estimate the activity duration based on the sensor events.
However, this approach is inefficient for complex activities (Bouchabou et
al., 2021a; Krishnan and Cook, 2014; Quigley et al., 2018; Shahi et al.,
2017).

There is a rise in deep learning approaches for HAR (Wang et al., 2019; Chen
et al., 2021; Bouchabou et al., 2021a, b; Liciotti et al., 2020). Guan and
Plötz (Guan and Plötz, 2017) claim that the deep learning method can be
insensitive to the window size in HAR. Yet, it is not the case for HAR
scenarios with sparse data since the mentioned studies are either on the pre-
segmented data (Bouchabou et al., 2021b) or their segmentation parameters
should be tuned to achieve satisfying performance (Chen et al., 2021).

To automate algorithm and hyperparameter selection, AutoML techniques are used
(Mu et al., 2022; Taylor et al., 2018). However, they do not adopt the
algorithm regarding the incoming data. Meta-learning, often known as learning
to learn, has been successfully used for algorithm selection (Aguiar et al.,
2019) and provides automatic and systematic guidance on algorithm selection
based on the information gained through a set of algorithms on various tasks
(Rossi et al., 2021). Meta-learning is not a novel concept (Schaul and
Schmidhuber, 2010); however, there has been a recent rise in interest in meta-
learning (Grefenstette et al., 2019). Hendryx et. al. (Hendryx et al., 2019)
and Aguiar et. al. (Aguiar et al., 2019) use a meta-learning approach across
different image tasks to select the proper algorithm for generating the mask
for a given image (Sun and Li, 2021). The fundamental reason for this study is
the fact that previous studies consider each experience as an independent
instance and do not consider the decomposition of each HAR task into sub-
tasks. Additionally, in IoT, the input sensor events in each experience are
characterized by their continuous and relative nature; therefore, they are not
independent (Fu, 2011; Cook and Narayanan, 2015).

To the best of our knowledge, no work has been done on dynamically selecting
the appropriate segmentation method and its hyperparameter over time, despite
the possibility that the appropriate approach and its corresponding
hyperparameter for one period may not be optimal for another period (Rossi et
al., 2021; Adam et al., 2019). Furthermore, the previous studies never view
the segmentation problem as a meta-decomposition one. In the next section, we
propose our novel approach to resolve these concerns.

##  3 Proposed Model

Our approach consists of two major steps: (a) redefining the segmentation
problem as the data decomposition problem and (b) formalizing our novel meta-
decomposition approach. In the following, we first introduce the definition
and terminology and then elaborate on each step.

Following the notations of (Schaul and Schmidhuber, 2010; Huisman et al.,
2021; Hospedales et al., 2022), let us consider domain $A$ as a set of
experiments. Experience $s\in A$ is a broad term used on both supervised and
non-supervised learning problems that may refer to an input-target tuple, a
single data point, a sequence of events (e.g., in IoT), etc. We define
$m_{\theta}$ as a task with hyperparameter $\theta$ (includes, e.g., the
initial model parameters, choice of the optimizer, and learning rate schedule)
that takes the input experiments and outputs the target activities based on
the constraints, objectives, etc. $\mathcal{\phi}(m_{\theta},s)$ is associated
with measuring the performance of task $m_{\theta}$ on the experiment $s$. We
denote by $\mathcal{L}(m_{\theta},S)$ the expected performance of task
$m_{\theta}$ on $S\subseteq A$, such that:

$\mathcal{L}(m_{\theta},S)=\mathbb{E}_{s\in
S}\left[\mathcal{\phi}(m_{\theta},s)\right]$ (1)

Measurement $\phi$ is as diverse as the application domains. For instance, in
supervised learning, $\phi$ might be the differences between task outputs and
teacher-given values (Schaul and Schmidhuber, 2010). Without losing
generality, we consider the optimum hyperparameter minimizes the expected
performance
($\theta^{*}_{S}=\texttt{argmin}_{\theta}\mathcal{L}(m_{\theta},S)$). Finding
globally $\theta^{*}$ is computationally infeasible (Huisman et al., 2021).
Therefore, we approximate it ($\theta^{*}_{S}\approx g_{\omega}(S)$) guided by
pre-defined meta-knowledge $\omega$ which includes, e.g., the initial model
parameters ($\theta_{0}$), choice of the optimizer, and learning rate schedule
(Hospedales et al., 2022).

In sensor-based HAR, each experiment contains a sequence of various sensors
occurrences, and activities information (such as their label and duration);
task $m_{\theta}$ refers to the activity recognition model and its
hyperparameters; and $\phi(m_{\theta},s)$ evaluates the performance of the
activity recognition model on the experiment $s$. For instance, $\phi$ can
evaluate the duration of correctly identified activities.

###  3.1 Decomposition

Even though decomposition is a well-known approach in designing algorithms
(Cormen et al., 2009), the data segmentation problem has never been viewed as
a data decomposition problem, which consists of a decomposer that splits the
input sequence into a set of smaller data (traditional segmentation),
resolutions that find the concepts from these smaller segments (usually less
complex than original resolutions), and a composer that combines the sub-
results to generate the overall results.

To the best of our knowledge, previous studies in the literature have not
considered the composer component (Krishnan and Cook, 2014; Qian et al., 2021;
Yala et al., 2017; De-La-Hoz-Franco et al., 2018; Cumin et al., 2017; Wang et
al., 2019; Chen et al., 2021; Hussain et al., 2020; Bernard et al., 2018;
Viard, 2018) These studies have made the implicit assumption that the
segmentation process preserves the integrity of the whole problem, and as
such, the overall system performance is assessed based on the output of each
segment. This hard hypothesis may misleadingly present convenient results
without even reducing the problem complexity, which is explained in Section
4.3. Therefore, this study explicitly redefines the segmentation problem as a
data decomposition that incorporates all three components: the decomposer, the
resolutions, and the composer. The introduced biases, loss of information, and
performance of each component can affect the overall performance of the system
and should be carefully evaluated. Furthermore, neglecting the composer
component would lead to inconsistencies in the comparison of different
segmentation algorithms, as it will be discussed in detail in Section 4.3.
Therefore, including the composer component in the segmentation problem is
crucial for accurately evaluating and comparing the performance of various
segmentation algorithms.

Accordingly, the decomposer task ($d_{\delta}$ parameterized by $\delta$)
decomposes $m_{\theta}$ into $M$ resolution sub-tasks
($\Pi_{\Psi}=\\{\pi^{i}_{\psi_{i}}\\}_{i=1:M}$ such that each sub-task is
parameterized by $\psi_{i}\\!\in\\!\Psi$), and the composer task ($c_{\sigma}$
parameterized by $\sigma$) that combines the results of sub-tasks to produce
the overall system results. Task $m_{\theta}$ is decomposable under the
measurement $\mathcal{L}$ to $\Pi_{\Psi}$ and $c_{\sigma}$ if and only if the
composition of sub-tasks does not perform worse up to $\epsilon$ than task
$m_{\theta}$. Formally:

$d_{\delta,\mathcal{L}}(m_{\theta})=\Pi_{\Psi},c_{\sigma}\ \iff\
\mathcal{L}(c_{\sigma}(\Pi_{\Psi}),A)-\mathcal{L}(m_{\theta},A)\leq\epsilon$
(2)

The task’s performance after decomposition can not surpass the original task
due to the severed relationship between events, leading to information loss.
When $\epsilon$ is zero, it means that $m_{\theta}$ is strongly decomposable
to $\Pi_{\Psi}$ and $c_{\sigma}$ without any loss of information, otherwise,
it is a weakly decomposable task, and some information is lost. $\delta,\Psi$,
and $\sigma$ show the dependencies of the model on pre-defined assumptions
about the decomposition, for example, the segmentation approach such as time
window and event window, and their internal parameters such as window size.
These assumptions can affect the global system’s performance. For example, the
optical character recognition (OCR) task is commonly decomposed into the sub-
tasks with sub-images (that each contains one character), and the composition
task merges the results of those tasks to produce the whole problem result
(full text). Equation 2 shows that the decomposability of a task depends on
the task target, i.e., on the objective function measured by $\mathcal{L}$.
For instance, while we can decompose the face recognition task to analyze only
the color frame task with an accuracy of 99.5% (Lu et al., 2021); this
decomposition may be inadequate in a highly secure application, where a more
detailed decomposition involving depth and color sub-tasks may be required
(Apple Inc., 2022).

Obviously, all the mentioned components (decomposer, resolution, and composer)
play a crucial role in measuring the performance, the introduced biases, loss
of information, and complexity of the whole system and should be considered in
designing and evaluating segmentation approaches. In particular, ignoring the
composer component leads to inconsistencies and difficulties in comparing
different segmentation algorithms, which are elaborated more in Section 4.3.

###  3.2 Meta Decomposition

In a traditional segmentation, the probability distribution of data is
supposed to be unknown but stationary. Nevertheless, the underlying
distribution of data in real-world IoT systems naturally changes over time
(Rossi et al., 2021). Additionally, fixing the segmentation and its hyper-
parameter is the second family of biases (Section 1) that often implicitly
incorporated with the prior knowledge or assumptions originating from the
developers, researchers, or experts.
Therefore, we propose our novel meta decomposition approach to resolve these
concerns. Learning-to-decompose or meta-decomposition is defined as a model
that can dynamically and systematically select and tune the decomposition
algorithm. Formally, in Equation 3, we consider
$d^{i}_{\delta_{i}}\in\mathcal{D}$ as the i-th decomposer task which generates
sub-tasks $\Pi^{i}_{\Psi_{i}}$ and the composer task $c^{i}_{\sigma_{i}}$;
then, we define the meta-decomposition task ($\widehat{d}_{\hat{\delta}}$) as
the selection of sub-tasks ($\widehat{\Pi}_{\hat{\Psi}}$) and the meta-
composer task ($\widehat{c}_{\hat{\sigma}}$), such that in the meta-
evaluation, the meta-decomposition task outperforms those decomposition tasks
individually.

$\widehat{d}_{\hat{\delta},\mathcal{L}}(m_{\theta})=\widehat{\Pi}_{\hat{\Psi}},\widehat{c}_{\hat{\sigma}},\\\
\quad s.t.,\widehat{\Pi}_{\hat{\Psi}}\subseteq\underset{i}{\cup}\
\Pi^{i}_{\Psi_{i}}\land\mathcal{L}(\widehat{c}_{\hat{\sigma}}(\widehat{\Pi}_{\hat{\Psi}}),A)\\!-\\!\underset{i}{\min\
}\mathcal{L}(c^{i}_{\sigma_{i}}(\Pi^{i}_{\Psi_{i}}),A)\\!<\\!0$ (3)

This definition is illustrated in Figure 1. The meta-decomposition task can be
carried out in several ways to efficiently and dynamically select the proper
segmentation approach and its hyperparameters depending on the incoming data,
application and constraints. Moreover, the proposed model can be easily
extended to the arbitrary number of meta-levels and is not limited to a single
layer of meta-decomposition. For example, meta-meta-decomposition algorithm
can generate the sub-tasks for the inner meta-decomposition algorithm.

As it is mentioned before, meta-learning (Schaul and Schmidhuber, 2010; Aguiar
et al., 2019; Vanschoren, 2019) has been successfully used for algorithm
selection over various tasks (e.g., (Sun and Li, 2021)); however, it required
multiple tasks and is not applicable for one single HAR task. In meta-
decomposition, we generate the sub-tasks from a single task. These sub-tasks
can be fed to the meta-learning approaches (Schaul and Schmidhuber, 2010).
Therefore, we can enhance the overall system performance without including
hard prior biases about the fixation of the segmentation method and its
hyperparameters. The next section describes more about it with an experiment.

Figure 1: (a) shows the conventional segmentation approach, which creates a
set of segments in data preparation and then treats them as individual
instances to be inputted into the ML system (abstract schema from (Kumar et
al., 2023)). (b) illustrates the proposed formulation of segmentation as a
data decomposition problem, including the decomposer, the ML model, and the
composer. (c) provides an overview of our proposed meta-decomposition model.
It can dynamically select the proper decomposition sub tasks from multiple
decomposition algorithms.

The current definition is open to interpretation regarding the distinction
between decomposition and meta-decomposition. Specifically, combining a
decomposition with a meta-decomposition, as well as any number of further
meta-meta-decompositions, can always be seen as a single "flat" decomposition
algorithm. On the other hand, some decomposition methods can be seen as a type
of meta-decomposition. For instance, the one that decomposes data and changes
the window size based on the input data while composing the results can be
considered a basic form of meta-decomposition.

##  4 Experiment

In this paper, we proposed the meta-decomposition to improve the overall
performance of the system where the change in the environment is inevitable
and a decomposer task in one period may become inappropriate in another
period. In other words, meta-decomposition adaptively learns the proper
decomposition for different data in dynamic environments (Rossi et al., 2021).

In the experiments, we demonstrate the meta-decomposition effectiveness in IoT
data in HAR. To select appropriate sub-tasks from the available decomposer
tasks, we first decompose this long data into a set of meta-segments; then
extract the meta-features of these meta-segments to learn how to select a
suitable base decomposition task. We can also extend this step to include a
higher-level meta-meta-decomposition task. However, we only consider one level
in these experiments for simplicity. The details of these experiments are: In
the following subsections, we detail our experiments, selected datasets,
environment, framework, baselines, and evaluation method. Following that, we
present a discussion on the results.

###  4.1 Experimental Setup

#### Datasets:

Experiments are conducted on various public testbeds, including the widely-
used (De-La-Hoz-Franco et al., 2018; Bouchabou et al., 2021a; Ariza-Colpas et
al., 2022) WSU CASAS Home1, Home2 (Krishnan and Cook, 2014), and Aruba (Cook,
2012) datasets that have around 32 sensors and between 250,000 to 1,700,000
events, Orange4Home (Orange4H) dataset (Cumin et al., 2017) that has 207
sensors and about 700,000 events. Each testbed consists of heterogeneous
sensor events and the daily activities of an individual in a smart apartment.
They have imbalanced activity classes, activity durations, and sensor events.
e.g., bathroom activities are frequent and last a few minutes with a few
sensor events, while cooking activities may occur once a day, last about an
hour, and involve numerous sensor events (Medina-Quero et al., 2018). To
enhance comprehension of these datasets, we have visualized them in Figures 2,
3, 4, 5, 6 and 7. Detailed information about each figure is provided in its
respective caption.

(a) Aruba. It contains the events from 34 binary sensors for 7 months.

(b) Home1. It contains the events from 32 binary sensors for 5 months.

(c) Home2. It contains the events from 30 binary sensors for a period of 5
months.

Figure 2: CASAS Aruba (Cook, 2012), Home1 and Home2 datasets (Krishnan and
Cook, 2014) sensors configuration. Around 70% of the activities are unlabeled.
Figure 3: Orange4Home Dataset Configuration - This dataset represents a two-
floor home with 236 sensors, including 83 binary, 55 integer, 67 float, and 31
categorical sensors. These sensors capture data related to motion, switches,
humidity, water consumption, luminosity, temperature, weather conditions, and
heater settings over a 5-month period. Figure 4: Orange4Home Activity
Durations: This box-plot depicts the duration of various activities within the
Orange4Home dataset. The y-axis measures time in seconds on a logarithmic
scale, showcasing the diversity in average activity durations. Activities are
listed on the x-axis, with durations ranging from 10 seconds (e.g., ’going
down’ activity) to approximately 3 hours (e.g., ’computing’ activity). Figure
5:  Sensor Event Frequency for the activities in the Aruba Dataset. For each
activity, a hit map is shown which represents the frequency and distribution
of sensor events in the Y-axis. The absence of events is shown in white, while
darker tones indicate higher event frequencies. On the legend, the number of
sensor’s heats are shown. These visual patterns reveal significant differences
in the occurrence and timing of sensor-triggered activities, such as between
’Meal Preparation’ and ’Wash Dishes’. Pre-segmented data showcases distinct
patterns, reducing ambiguity and enhancing the recognition performance of
activities. Although valuable for experimental analysis, the practicality of
pre-segmented data in real-world scenarios may be limited. Similar observation
exists in the other datasets that are represented in the appendix.  Figure 6:
Example of Daily Activities from the Home1 Dataset. The pattern of one week is
represented by a compact bar at the image’s bottom, with the selected day
accentuated for emphasis. The y-axis enumerates the different classes of
activities, while the horizontal lines mark the length of each activity’s
occurrence. Notably, the consistency in activity patterns across various days
calls for careful analysis to avoid overfitting by overlooking temporal
factors. The patterns of other datasets are available in the appendix. Figure
7: An extract of Home2 dataset with raw data. Within this dataset, annotated
sensor events encompass various predefined categories of daily life
activities, and the untagged sensor events are consistently labeled as "Other
Activity". The start and end terms indicate the initiation and conclusion of
activities. In the implementation, categorical information is encoded using a
one-hot encoding approach. Within CASAS datasets, events are derived from
various types of sensors. Specifically, motion sensors are denoted by IDs
starting with "M," door closure sensors by IDs starting with "D," and
temperature sensors by IDs beginning with "T."

#### Environment:

All experiments are run on an NVIDIA DGX-1 machine featuring a Tesla V100-32
GPU, Intel Xeon E5-2698v4 CPUs, and 512 GB of RAM. However, our framework
works also on a personal computer.

###  4.2 Framework Description and Baseline

Our pipeline infers activities and their duration from raw sensor data. The
pipeline is composed of several stages: data pre-processing, meta-
decomposition, feature extraction, classification, and meta-composition. For
each stage, various techniques are implemented in our repository. However,
without losing generality in this experiment, we have fixed the parameters of
the inner learner to focus on the meta-decomposition. For the inner learner, a
fully convolutional network (FCN) is selected. It outperforms the long-short-
term memory (LSTM) networks, while it is significantly quicker (Bouchabou et
al., 2021a, b). It treats sensor events as words and activity sequences as
text sentences. Therefore, they encode each sensor event as a word containing
the sensor name and its value. For example, if a sensor with id ’door1’ fire
an ’open’ event, it will be encoded as "door1open". Then, based on the
frequency of each word, it will be indexed from 1 (index zero is reserved for
padding). Then each sequence of sensor events in a window is mapped to an
activity. A sequential model with three layers of conv1D, batch normalization,
and relu activation with 128, 256, and 128 filters, 1D global average pooling,
and softmax layers is used. The hyperparameters of the model in the training
phase include the batch size of 1024, epochs limit of 100, validation split of
0.2, Adam optimizer, and categorical cross-entropy loss. Afterward, the
composition step converts the ML results to the problem space. As explained
before, this step is ignored by several studies. This step itself is a
challenging problem and directly impacts the result. We demonstrate its
importance using a basic combiner that combines overlapped and neighbor
windows.

This paper’s idea is demonstrated through experiments using a straightforward
yet effective method called SWMeta. Although there is potential for multiple
higher-level meta-meta-decompositions, this study only focuses on one layer of
meta-decomposition, breaking down the data into one-day meta-segments. Then,
we select randomly $J$ meta segments (in this experiment, $J=8$) and use grid
search to find the inner decomposer’s hyperparameters for each meta-segment.
The inner model parameters is then updated with new decomposer. This process
is repeated 100 times in this experiment. Next, for each meta-segment, proper
decomposer parameters will be selected by starting from the global knowledge
obtained from the previous step to update the local knowledge that is proper
for this meta-segment. We add the meta-features from this meta-segment and the
selected decomposer parameters to the new train set. For this, we extract the
meta-features containing the number of events triggered by each sensor
(normalized by the mean and scaling to unit variance) and the spline
transformed day of week and month (Eilers and Marx, 1996). After training the
new model using this new training set, we estimate the proper decomposer
parameters for each meta-segments in the test set. Next, we generate the
segments, predict the activity of each segment and compose the predicted
activities. After that, we apply the meta-composer to generate global problem
solutions. Based on the recent surveys of HAR in smart homes, TW, EW, and DW
(probabilistic (Krishnan and Cook, 2014)) are the most used segmentation
approaches (Bouchabou et al., 2021a; Ariza-Colpas et al., 2022; Minh Dang et
al., 2020; Wang et al., 2021). Therefore, our meta-decomposer selects the
decomposer’s hyperparameters (segmentation algorithm and its parameters)
dynamically among them. Finally, we use a multi-layer perceptron model with
four hidden layers (three sequential dense layers with 16 Relu activations and
batch normalizations and one layer with softmax and linear activation) to
train our model to estimate the inner segmentation hyperparameters. The
general idea of this algorithm that is inspired from MAML (Finn et al., 2017)
is shown in the Algorithm 1.

Algorithm 1 Simple Meta-Decomposition (SWMeta)

Training dataset $A^{train}$, Testing dataset $A^{test}$

Hyperparameters $\widehat{\delta}$ $\triangleright$ e.g., meta-segment size,
$\gamma$

Predicted activities for $A^{test}$

Initialize primary model $M$ and segment decomposer $D$ using
$\widehat{\delta}$.

Generate meta-segments for training:
$\mathcal{T}=\\{\mathcal{T}_{1},...,\mathcal{T}_{n}\\}$ from $A^{train}$.

while termination criterion not met do

Sample a batch $B$ of $J$ tasks from $\mathcal{T}$.

for each $(Z^{train},Z^{val})=\mathcal{T}_{j}$ in $B$ do

Optimize $D$ for best segmentation of $M$ using $Z^{train}$.

Decompose validation data: $S=D(Z^{val})$.

Update and train $M$ using segmented data $S$.

end for

end while

Initialize meta-feature matrix $X$ and decomposer vector $y$.

for each task $\mathcal{T}_{i}$ in $\mathcal{T}$ do

Optimize $D^{\prime}$ for best segmentation starting from $D$ on
$\mathcal{T}_{i}$.

Extract meta-features: $F=\text{MetaFeatures}(\mathcal{T}_{i})$.

$X$.append($F$), $y$.append($D^{\prime}$).

end for

Train model $N$ on the $(X,y)$.

Generate meta-segments for testing: $\mathcal{T^{\prime}}$ from $A^{test}$.

Initialize predicted activities list $C$.

for each task $\mathcal{T}_{i}$ in $\mathcal{T^{\prime}}$ do

Extract meta-features: $F=\text{MetaFeatures}(\mathcal{T}_{i})$.

Predict decomposer: $D^{\prime}=N(F)$.

Decompose task: $S=D^{\prime}(\mathcal{T}_{i})$.

Initialize result list $R$.

for each segment $s$ in $S$ do

Predict activity $k$ for segment $s$ using $M$.

$R$.append($k$).

end for

$C$.append(compose($R$)).

end for

return metaCompose($C$).

###  4.3 Performance Measurements

Evaluating the model quality is essential to compare and optimize different
approaches. As described in the decomposition definition, the processing
performance depends on the decomposer, composer, the number of segments and
size (structure), and resolution. Decomposers generate segments with various
sizes and structures. Thus, it is impossible to compare their quality without
transforming the results into a unified space.

Figure 8: Comparison of two segmentation algorithms. One of the segments in
the first method and two of those in the second method fail to detect Activity
$A$ accurately. The box shows the activity and its duration. The vertical
colored lines in the sensor sequence represent the activation of various
sensors at different time intervals (represented by the horizontal line).
Correct predictions are denoted by ’$\checkmark$’ while incorrect ones are
denoted by ’$\times$’.

Figure 8 illustrates two examples of HAR systems that use different
segmentation algorithms. Activity $A$ is not appropriately detected in half of
the segments in the first segmentation method, while it is not detected in the
40 percent for the second segmentation method. Classifier metrics are
frequently used to analyze the performance of HAR systems (Kumar et al., 2023;
Krishnan and Cook, 2014; Ni et al., 2015; Cook and Narayanan, 2015; Fu, 2011;
Qian et al., 2021; Yala et al., 2017; De-La-Hoz-Franco et al., 2018; Cumin et
al., 2017; Bouchabou et al., 2021a; Chen et al., 2021; Bernard et al., 2018;
Viard, 2018) However, it may lead to biased results when comparing different
segmentation approaches. For instance, in Figure 8, the class accuracy is 50%
in the first segmentation method, while it is 60% in the second one.
Obviously, their performances are similar in terms of duration. However, the
aforementioned metric fails to represent the situation correctly as the
various segmentation approaches can alter the problem space substantially.
Moreover, activities have some properties related to their duration (Modaresi
et al., 2022). For example, steady recognition of the sleeping activity is
critical; otherwise, it may misleadingly present a disorder (Alemdar et al.,
2015). However, the segmentation process may break these properties.

Therefore, after applying the composition step, we adopt the time slice (TS)
based confusion matrix (CM) (Kasteren et al., 2011) to evaluate different
segmentation methods in a unified space. This TS-CM helps us to compare
f-score, accuracy, recall (TPR), and other CM measures in an identical space.
Figure 9 shows the calculation of TS-CM on an activity.

Figure 9: An example TS-CM calculation after composing the classifier results.
(abbr. T=True, F=False, P=Positive, N=Negative)

To obtain the generalized performance, five-fold cross-validation is used for
model evaluation, which is a wide approach used for model evaluation in HAR
(Bouchabou et al., 2021a). It splits the dataset into five parts based on
temporal occurrence. At each step, four parts are selected for training and
the remaining part for testing. Then, we iterate on the parts until all the
parts are used for testing. To preserve the continuous nature of events, the
events of each day appear on only one part. Each configuration is repeated
five times, and the average and standard deviation of its results are
presented.

###  4.4 Results and Discussion

Figure 10: The impact of two segmentation methods (EW and TW) and their parameters (window size and the best shift parameter with that window size) on both train and a test set of the Home2 dataset with classifier metric and TS-CM metric. Interestingly, we can observe that increasing the window size increases the performance measured by the classifier metric, while when we apply the composer to the results and calculate the TS-CM measure, the performance decreases. It demonstrates once more how crucial it is to include the composition component in the segmentation process. Table 1: Performance evaluation of methods used for segmentation. For the first three methods, the best hyperparameter is selected and shown in parentheses. Our proposed method (SWMeta) dynamically selects the appropriate segmentation method and its hyperparameter at each time. The preliminary results demonstrate that SWMeta outperforms the other methods alone. These experiments show uncontrollable biases introduced by the segmentation process can be reduced, as is expected in the formulation of meta-decomposition. In this table, $w$ and $s$ refer to window size and shift.  Dataset |  Segmentor |  TPR | F1
---|---|---|---
CASAS Home1 (11 classes) |  EW (w=5, s=2) |  0.65±0.04 | 0.42±0.03
TW (w=30, s=20) |  0.48±0.09 | 0.41±0.05
DW |  0.35±0.01 | 0.27±0.01
SWMeta |  0.65±0.03 |  0.43±0.03
CASAS Home2 (11 classes) |  EW (w=6,s=3) |  0.56±0.08 | 0.40±0.02
TW (w=50, s=40) |  0.52±0.07 |  0.42±0.04
DW |  0.32±0.01 | 0.21±0.01
SWMeta |  0.50±0.12 | 0.39±0.09
CASAS Aruba (11 classes) |  EW (w=3, s=3) |  0.59±0.05 | 0.34±0.04
TW (w=60, s=50) |  0.47±0.06 | 0.33±0.05
DW |  0.26±0.03 | 0.21±0.01
SWMeta |  0.61±0.04 |  0.39±0.05
Orange4H (24 classes) |  EW (w=40, s=20) |  0.27±0.07 | 0.32±0.05
TW (w=60, s=60) |  0.32±0.08 | 0.35±0.06
DW |  0.30±0.01 | 0.34±0.01
SWMeta |  0.34±0.04 |  0.36±0.03

The proposed method is a meta-decomposition method (traditionally
segmentation) to be used by recognition methods, not a recognition method in
itself. The impact of the segmentation methods and their parameters are shown
in Figure 10. It highlights the importance of the composition step in the
segmentation process and shows that our segmentation reformulation as a
decomposition problem improves evaluating of the biases introduced by the
segmentation step. For instance, in the initial subfigure of Figure 10, it is
noticeable that augmenting the size parameter in EW results in an enhancement
in performance in the absence of composer (classic), however, it leads to a
reduction in performance after the inclusion of the composer (TS-CS).
Furthermore, it is worth mentioning that employing 30 events size, as utilized
in various researches such as (Bouchabou et al., 2021a; Aminikhanghahi and
Cook, 2019), introduces a substantial bias. The same applies to TW, thereby
necessitating caution in interpreting the results. To show the usefulness of
the meta-decomposition concept, in these experiments, our method learns the
appropriate segmentation method each time in the training phase. Then, in the
test phase, it selects the appropriate segmentation method and its
hyperparameter dynamically at each time. To demonstrate the superiority of
this approach, we compare it with the best hyperparameter of each method
individually, which heavily rely on human experience or domain knowledge. The
results are summarized in Table 1. To find this best parameter for the
baseline, we conducted a grid search on each dataset. As we can observe from
the table that the recommended window size of 60 seconds for TW in (Bouchabou
et al., 2021a; Medina-Quero et al., 2018; Hamad et al., 2021, 2020) introduces
a bias, as the optimal hyperparameter varies between 30 and 60 seconds for
different datasets. Our proposed approach dynamically selects the best
segmentation method at each time among those methods and outperforms those
methods individually, except for the Home 2 dataset, which contains few sensor
events, thus meta-segment does not have enough data to predict the proper
segmentation method and its hyperparameters.

For our inner learning model, we adopt the deep learning model proposed by
Bouchabou et. al. (Bouchabou et al., 2021b) which is described in Section 4.2.
Assuming identical settings, our results would have been equivalent. However,
we introduced three distinct differences in this experiment. First, we include
the composition step, which means we rebuild the initial problem results and
evaluate the results on that space instead of considering the classification
performance, which is more described in Section 4.3. As shown in Figure 10, it
produces noticeable disparities. Second, they assumed that the input sensor
events are pre-segmented based on the activity duration; then, they applied
the windowing approach to each segment before the deep-learning step, while we
do not have such an assumption, which results in the inclusion of significant
noise in the learning model. Third, we use the macro average while they use
the weighted average, which gives more weight to the dominant activities.

These experiments show that segmentation may introduce uncontrollable biases
and reduce recognition quality, while, our meta-decomposition concept lessens
uncontrollable biases in segmentation by dynamically choosing the proper
decomposer and its parameters based on meta-features. They also show that ML
can better decompose (traditionally segment) the recognizing activities from
sensor data into multiple subtasks without implicitly including knowledge
about the problem domain.

##  5 Conclusion and Future work

Segmentation is often considered without the composer part; however, the
composer part is an essential step to reduce the implicit bias of the
segmentation. Therefore, we redefine the segmentation problem as a data
decomposition problem, including a decomposer, resolutions, and a composer. In
addition, while the majority of work in the literature focuses on fixed
segmentation approaches that heavily rely on human experience or domain
knowledge, we propose the idea of meta-decomposition or learning how-to-
decompose to consider the segmentation process as a hyperparameter inside the
outer optimization loop to adaptively select the appropriate one based on the
incoming data. It controls and consequently reduces additional biases
introduced by this step. This framework is the first step towards enhancing
the HAR quality without implicitly importing human biases about the
application and the used dataset in the algorithms, implementations, and
evaluations. Since the segmentation step changes the problem space and
different segmentation algorithms generate heterogeneous segments, this paper
discussed and proposed to evaluate them in a unified space. The experiments
demonstrate that the proposed meta-decomposition concept improves the overall
machine learning performance and needs to be considered in future studies. We
hope that this work will open the way for proposing more effective meta-
decomposition approaches incorporated with meta-learning approaches in our
future study.

## Declaration of Competing Interest

The authors declare that they have no known competing financial interests or
personal relationships that could have appeared to influence the work reported
in this paper.

## References

  * Kumar et al. [2023] Manish Kumar, Pramod Kumar Singh, Manish Kumar Maurya, and Anubhav Shivhare.  A survey on event detection approaches for sensor based IoT.  _Internet of Things (Netherlands)_ , 22(November 2022):100720, 2023.  ISSN 25426605.  doi:10.1016/j.iot.2023.100720.  URL https://doi.org/10.1016/j.iot.2023.100720.
  * Perera et al. [2014] Charith Perera, Arkady Zaslavsky, Peter Christen, and Dimitrios Georgakopoulos.  Context Aware Computing for The Internet of Things: A Survey.  _IEEE Communications Surveys & Tutorials_, 16(1):414–454, 2014.  ISSN 1553-877X.  doi:10.1109/SURV.2013.042313.00197.  URL http://ieeexplore.ieee.org/document/6512846/.
  * Messaoud et al. [2020] Seifeddine Messaoud, Abbas Bradai, Syed Hashim Raza Bukhari, Pham Tran Anh Quang, Olfa Ben Ahmed, and Mohamed Atri.  A survey on machine learning in Internet of Things: Algorithms, strategies, and applications.  _Internet of Things (Netherlands)_ , 12:1–43, 2020.  ISSN 25426605.  doi:10.1016/j.iot.2020.100314.
  * Mocrii et al. [2018] Dragos Mocrii, Yuxiang Chen, and Petr Musilek.  IoT-based smart homes: A review of system architecture, software, communications, privacy and security.  _Internet of Things (Netherlands)_ , 1-2:81–98, 2018.  ISSN 25426605.  doi:10.1016/j.iot.2018.08.009.  URL https://doi.org/10.1016/j.iot.2018.08.009.
  * Qian et al. [2021] Hangwei Qian, Sinno Jialin Pan, and Et.al.  Latent Independent Excitation for Generalizable Sensor-based Cross-Person Activity Recognition.  _AAAI_ , 35(13):11921–11929, 5 2021.  URL https://ojs.aaai.org/index.php/AAAI/article/view/17416www.aaai.org.
  * Chen et al. [2021] Kaixuan Chen, Dalin Zhang, Lina Yao, Bin Guo, Zhiwen Yu, and Yunhao Liu.  Deep Learning for Sensor-based Human Activity Recognition.  _ACM Computing Surveys_ , 54(4):1–40, 7 2021\.  ISSN 0360-0300.  doi:10.1145/3447744.  URL http://arxiv.org/abs/2001.07416https://dl.acm.org/doi/10.1145/3447744.
  * Ariza-Colpas et al. [2022] Paola Patricia Ariza-Colpas, Enrico Vicario, Ana Isabel Oviedo-Carrascal, Shariq Butt Aziz, Marlon Alberto Piñeres-Melo, Alejandra Quintero-Linero, and Fulvio Patara.  Human Activity Recognition Data Analysis: History, Evolutions, and New Trends, 4 2022.  ISSN 14248220.  URL https://www.mdpi.com/1424-8220/22/9/3401/pdf?version=1651203966https://www.mdpi.com/1424-8220/22/9/3401.
  * Sokullu et al. [2020] Radosveta Sokullu, Mustafa Alper Akkaş, and Eren Demir.  IoT supported smart home for the elderly.  _Internet of Things (Netherlands)_ , 11, 2020.  ISSN 25426605.  doi:10.1016/j.iot.2020.100239.
  * Najeh et al. [2022] Houda Najeh, Christophe Lohr, and Benoit Leduc.  Dynamic Segmentation of Sensor Events for Real-Time Human Activity Recognition in a Smart Home Context.  _Sensors_ , 22(14):5458, 7 2022.  ISSN 1424-8220.  doi:10.3390/s22145458.  URL https://www.mdpi.com/1424-8220/22/14/5458.
  * Bouchabou et al. [2021a] Damien Bouchabou, Sao Mai Nguyen, and Et.al.  A survey of human activity recognition in smart homes based on iot sensors algorithms: Taxonomies, challenges, and opportunities with deep learning.  _Sensors_ , 21(18), 2021a.  ISSN 14248220.  doi:10.3390/s21186037.  URL https://www.mdpi.com/1424-8220/21/18/6037/pdf?version=1631186192.
  * Hu et al. [2017] Yupeng Hu, Cun Ji, Ming Jing, and Et.al.  A Continuous Segmentation Algorithm for Streaming Time Series.  In _EAI CollaborateCom_ , pages 140–151, 2017.  ISBN 978-3-319-59288-6.  doi:10.1007/978-3-319-59288-6_13.
  * Hu et al. [2019] Yupeng Hu, Pengjie Ren, Wei Luo, Peng Zhan, and Xueqing Li.  Multi-resolution representation with recurrent neural networks application for streaming time series in IoT.  _Computer Networks_ , 152:114–132, 4 2019.  ISSN 13891286.  doi:10.1016/j.comnet.2019.01.035.  URL https://doi.org/10.1016/j.comnet.2019.01.035https://linkinghub.elsevier.com/retrieve/pii/S1389128619300660.
  * Fu [2011] Tak Chung Fu.  A review on time series data mining.  _Engineering Applications of Artificial Intelligence_ , 24(1):164–181, 2011.  doi:10.1016/j.engappai.2010.09.007.
  * Cook and Narayanan [2015] Diane J. Cook and C Krishnan Narayanan.  _Activity Learning: Discovering, Recognizing, and Predicting Human Behavior from Sensor Data_.  Wiley Series on Parallel and Distributed Computing. Wiley, 1 edition, 2015\.  ISBN 111889376X,9781118893760.
  * Ni et al. [2015] Qin Ni, Ana García Hernando, and Iván de la Cruz.  The Elderly’s Independent Living in Smart Homes: A Characterization of Activities and Sensing Infrastructure Survey to Facilitate Services Development.  _Sensors_ , 15(5):11312–11362, 5 2015.  doi:10.3390/s150511312.
  * Demrozi et al. [2021] Florenc Demrozi, Cristian Turetta, and Graziano Pravadelli.  B-HAR: an open-source baseline framework for in depth study of human activity recognition datasets and workflows.  _arXiv_ , pages 1–9, 1 2021.  URL http://arxiv.org/abs/2101.10870.
  * Krishnan and Cook [2014] Narayanan C. Krishnan and Diane J. Cook.  Activity recognition on streaming sensor data.  _Pervasive and Mobile Computing_ , 10(PART B):138–154, 2 2014.  doi:10.1016/j.pmcj.2012.07.003.
  * Mitchell and Mitchell [1980] Tom M Mitchell and Tom M Mitchell.  The Need for Biases in Learning Generalizations.  _Rutgers CS tech report_ , 1(May), 1980.  URL https://www.cs.cmu.edu/~tom/pubs/NeedForBias_1980.pdf.
  * Gordon and Desjardins [1995] Diana F. Gordon and Marie Desjardins.  Evaluation and Selection of Biases in Machine Learning.  _Machine Learning_ , 20(1):5–22, 1995.  ISSN 15730565.  doi:10.1023/A:1022630017346.
  * Bilen et al. [2020] Cagdas Bilen, Giacomo Ferroni, Francesco Tuveri, Juan Azcarreta, and Sacha Krstulovic.  A Framework for the Robust Evaluation of Sound Event Detection.  In _ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing_ , pages 61–65, 2020.  ISBN 9781509066315.  doi:10.1109/ICASSP40776.2020.9052995.
  * Modaresi et al. [2022] Seyed Modaresi, Aomar Osmani, Mohammadreza Razzazi, and Abdelghani Chibani.  Uniform Evaluation of Properties in Activity Recognition.  In _Advances in Knowledge Discovery and Data Mining_. Springer International Publishing, 2022.
  * Alemdar et al. [2015] Hande Alemdar, Can Tunca, and Cem Ersoy.  Daily life behaviour monitoring for health assessment using machine learning: bridging the gap between domains.  _Personal and Ubiquitous Computing_ , 19(2):303–315, 2015.  ISSN 16174909.  doi:10.1007/s00779-014-0823-y.
  * Aguiar et al. [2019] Gabriel Jonas Aguiar, Rafael Gomes Mantovani, Saulo M. Mastelini, André C.P.F.L. de Carvalho, Gabriel F.C. Campos, and Sylvio Barbon Junior.  A meta-learning approach for selecting image segmentation algorithm.  _Pattern Recognition Letters_ , 128:480–487, 2019.  ISSN 01678655.  doi:10.1016/j.patrec.2019.10.018.
  * Rossi et al. [2021] André Luis Debiaso Rossi, Carlos Soares, Bruno Feres de Souza, and André Carlos Ponce de Leon Ferreira de Carvalho.  Micro-MetaStream: Algorithm selection for time-changing data.  _Information Sciences_ , 565:262–277, 2021.  ISSN 00200255.  doi:10.1016/j.ins.2021.02.075.
  * Huisman et al. [2021] Mike Huisman, Jan N. van Rijn, and Aske Plaat.  A survey of deep meta-learning.  _Artificial Intelligence Review_ , 54(6):4483–4541, 8 2021.  ISSN 0269-2821.  doi:10.1007/s10462-021-10004-4.  URL https://doi.org/10.1007/s10462-021-10004-4https://link.springer.com/10.1007/s10462-021-10004-4.
  * Mu et al. [2022] Tianyu Mu, Hongzhi Wang, Chunnan Wang, Zheng Liang, and Xinyue Shao.  Auto-CASH: A meta-learning embedding approach for autonomous classification algorithm selection.  _Information Sciences_ , 591:344–364, 2022.  ISSN 00200255.  doi:10.1016/j.ins.2022.01.040.  URL https://doi.org/10.1016/j.ins.2022.01.040.
  * Taylor et al. [2018] Ben Taylor, Vicent Sanz Marco, Willy Wolff, Yehia Elkhatib, and Zheng Wang.  Adaptive deep learning model selection on embedded systems.  In _Proceedings of the 19th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems_ , pages 31–43, New York, NY, USA, 6 2018. ACM.  ISBN 9781450358033.  doi:10.1145/3211332.3211336.  URL https://dl.acm.org/doi/10.1145/3211332.3211336.
  * Minh Dang et al. [2020] L. Minh Dang, Kyungbok Min, Hanxiang Wang, Md Jalil Piran, Cheol Hee Lee, and Hyeonjoon Moon.  Sensor-based and vision-based human activity recognition: A comprehensive survey.  _Pattern Recognition_ , 108, 2020.  ISSN 00313203.  doi:10.1016/j.patcog.2020.107561.
  * De-La-Hoz-Franco et al. [2018] Emiro De-La-Hoz-Franco, Paola Ariza-Colpas, Javier Medina Quero, and Macarena Espinilla.  Sensor-Based Datasets for Human Activity Recognition – A Systematic Review of Literature.  _IEEE Access_ , 6(c):59192–59210, 2018.  ISSN 2169-3536.  doi:10.1109/ACCESS.2018.2873502.  URL https://ieeexplore.ieee.org/document/8478653/.
  * Xu et al. [2020] Zimin Xu, Guoli Wang, and Xuemei Guo.  Sensor-based activity recognition of solitary elderly via stigmergy and two-layer framework.  _Engineering Applications of Artificial Intelligence_ , 95(November 2019):103859, 2020.  ISSN 09521976.  doi:10.1016/j.engappai.2020.103859.
  * Cumin et al. [2018] Julien Cumin, Julien Cumin Recognizing, Human-computer Interaction, and Julien Cumin.  _Recognizing and predicting activities in smart homes_.  PhD thesis, Université Grenoble Alpes, 12 2018.  URL https://tel.archives-ouvertes.fr/tel-02057332.
  * Yala et al. [2017] Nawel Yala, Belkacem Fergani, and Anthony Fleury.  Towards improving feature extraction and classification for activity recognition on streaming data.  _Journal of Ambient Intelligence and Humanized Computing_ , 8(2):177–189, 2017.  doi:10.1007/s12652-016-0412-1.
  * Wan et al. [2015] Jie Wan, Michael J. O’Grady, and Gregory M.P. O’Hare.  Dynamic sensor event segmentation for real-time activity recognition in a smart home context.  _Personal and Ubiquitous Computing_ , 19(2):287–301, 2015.  ISSN 16174909.  doi:10.1007/s00779-014-0824-x.
  * Sfar and Bouzeghoub [2018] Hela Sfar and Amel Bouzeghoub.  Dynamic Streaming Sensor Data Segmentation for Smart Environment Applications.  In _Neural Information Processing_ , volume 3316, pages 67–77. Springer International Publishing, 2018.  ISBN 978-3-540-23931-4.  doi:10.1007/978-3-030-04224-0_7.  URL http://www.springerlink.com/content/r9m8upr0gc4tttqphttp://link.springer.com/10.1007/978-3-030-04224-0_7.
  * Triboan et al. [2019] Darpan Triboan, Liming Chen, Feng Chen, and Zumin Wang.  A semantics-based approach to sensor data segmentation in real-time Activity Recognition.  _Future Generation Computer Systems_ , 93:224–236, 2019\.  ISSN 0167739X.  doi:10.1016/j.future.2018.09.055.  URL https://doi.org/10.1016/j.future.2018.09.055.
  * Wang and Miao [2018] Wei Wang and Chunyan Miao.  Activity Recognition in New Smart Home Environments.  In _Proceedings of the 3rd International Workshop on Multimedia for Personal Health and Health Care - HealthMedia’18_ , pages 29–37, New York, New York, USA, 2018. ACM Press.  ISBN 9781450359825.  doi:10.1145/3264996.3265001.  URL http://dl.acm.org/citation.cfm?doid=3264996.3265001.
  * Ortiz Laguna et al. [2011] Javier Ortiz Laguna, Angel Garcia Olaya, and Daniel Borrajo.  A Dynamic Sliding Window Approach for Activity Recognition.  In _Practice Nurse_ , volume 47, pages 219–230. -, 2011.  ISBN 978-3-642-22361-7.  doi:10.1007/978-3-642-22362-4_19.  URL http://link.springer.com/10.1007/978-3-642-22362-4_19.
  * Lunardi et al. [2018] Gabriel Machado Lunardi, Fadi Al Machot, Vladimir A. Shekhovtsov, Vinícius Maran, Guilherme Medeiros Machado, Alencar Machado, Heinrich C. Mayr, and José Palazzo M. de Oliveira.  IoT-based human action prediction and support.  _Internet of Things (Netherlands)_ , 3-4:52–68, 2018.  ISSN 25426605.  doi:10.1016/j.iot.2018.09.007.  URL https://doi.org/10.1016/j.iot.2018.09.007.
  * Tak-Chung Fu et al. [2001] Tak-Chung Fu, Fu-lai Chung, V Ng, and R Luk.  Evolutionary segmentation of financial time series into subsequences.  In _Proceedings of the 2001 Congress on Evolutionary Computation_ , volume 1, pages 426–430. IEEE, 5 2001.  ISBN 0-7803-6657-3.  doi:10.1109/CEC.2001.934422.  URL http://ieeexplore.ieee.org/document/934422/.
  * Aminikhanghahi and Cook [2019] Samaneh Aminikhanghahi and Diane J. Cook.  Enhancing activity recognition using CPD-based activity segmentation.  _Pervasive and Mobile Computing_ , 53:75–89, 2019.  ISSN 15741192.  doi:10.1016/j.pmcj.2019.01.004.  URL https://doi.org/10.1016/j.pmcj.2019.01.004.
  * Zameni et al. [2020] Masoomeh Zameni, Amin Sadri, Zahra Ghafoori, Masud Moshtaghi, Flora D. Salim, and Et. Al.  Unsupervised online change point detection in high-dimensional time series.  _Knowledge and Information Systems_ , 62(2):719–750, 2 2020.  ISSN 0219-1377.  doi:10.1007/s10115-019-01366-x.  URL https://doi.org/10.1007/s10115-019-01366-xhttp://link.springer.com/10.1007/s10115-019-01366-x.
  * Wang et al. [2021] Aiguo Wang, Shenghui Zhao, Chundi Zheng, Jing Yang, Guilin Chen, and Chih Yung Chang.  Activities of Daily Living Recognition with Binary Environment Sensors Using Deep Learning: A Comparative Study.  _IEEE Sensors Journal_ , 21(4):5423–5433, 2021\.  ISSN 15581748.  doi:10.1109/JSEN.2020.3035062.
  * Kasteren et al. [2011] Tim Van Kasteren, Hande Alemdar, and Cem Ersoy.  Effective performance metrics for evaluating activity recognition methods.  In _ARCS_ , 2011.
  * Medina-Quero et al. [2018] Javier Medina-Quero, Shuai Zhang, Chris Nugent, and M. Espinilla.  Ensemble classifier of long short-term memory with fuzzy temporal windows on binary sensors for activity recognition.  _Expert Systems with Applications_ , 114:441–453, 12 2018\.  ISSN 09574174.  doi:10.1016/j.eswa.2018.07.068.  URL https://doi.org/10.1016/j.eswa.2018.07.068https://linkinghub.elsevier.com/retrieve/pii/S0957417418304937.
  * Hamad et al. [2021] Rebeen Ali Hamad, Masashi Kimura, Longzhi Yang, Wai Lok Woo, and Bo Wei.  Dilated causal convolution with multi-head self attention for sensor human activity recognition.  _Neural Computing and Applications_ , 33(20):13705–13722, 2021.  ISSN 14333058.  doi:10.1007/s00521-021-06007-5.  URL https://doi.org/10.1007/s00521-021-06007-5https://link.springer.com/content/pdf/10.1007/s00521-021-06007-5.pdf.
  * Hamad et al. [2020] Rebeen Ali Hamad, Alberto Salguero Hidalgo, Mohamed-Rafik Bouguelia, Macarena Espinilla Estevez, and Javier Medina Quero.  Efficient Activity Recognition in Smart Homes Using Delayed Fuzzy Temporal Windows on Binary Sensors.  _IEEE Journal of Biomedical and Health Informatics_ , 24(2):387–395, 2020.  doi:10.1109/JBHI.2019.2918412.
  * Quigley et al. [2018] Bronagh Quigley, Mark Donnelly, George Moore, and Leo Galway.  A Comparative Analysis of Windowing Approaches in Dense Sensing Environments.  In _UCAmI 2018_ , page 1245, Basel Switzerland, 10 2018. MDPI.  doi:10.3390/proceedings2191245.  URL https://www.mdpi.com/2504-3900/2/19/1245.
  * Shahi et al. [2017] Ahmad Shahi, Brendon J Woodford, and Hanhe Lin.  Dynamic Real-Time Segmentation and Recognition of Activities Using a Multi-feature Windowing Approach.  In _Pacific-Asia Conference on Knowledge Discovery and Data Mining_ , volume 10526, pages 26–38, 2017.  ISBN 978-3-319-67273-1.  doi:10.1007/978-3-319-67274-8_3.  URL http://link.springer.com/10.1007/978-3-319-67274-8_3.
  * Wang et al. [2019] Jindong Wang, Yiqiang Chen, Shuji Hao, Xiaohui Peng, and Lisha Hu.  Deep learning for sensor-based activity recognition: A survey.  _Pattern Recognition Letters_ , 119:3–11, 3 2019.  ISSN 01678655.  doi:10.1016/j.patrec.2018.02.010.  URL https://doi.org/10.1016/j.patrec.2018.02.010https://jd92.wang/assets/files/a10_prl18.pdfhttps://github.com/jindongwang/Deep-learning-activity-recognition.
  * Bouchabou et al. [2021b] Damien Bouchabou, Sao Mai Nguyen, Christophe Lohr, Benoit LeDuc, and Ioannis Kanellos.  Fully Convolutional Network Bootstrapped by Word Encoding and Embedding for Activity Recognition in Smart Homes.  In _Communications in Computer and Information Science_ , volume 1370, pages 111–125. -, 12 2021b.  ISBN 9789811605741.  doi:10.1007/978-981-16-0575-8_9.  URL https://hal.archives-ouvertes.fr/hal-03032449/documenthttps://link.springer.com/10.1007/978-981-16-0575-8_9http://arxiv.org/abs/2012.02300.
  * Liciotti et al. [2020] Daniele Liciotti, Michele Bernardini, Luca Romeo, and Emanuele Frontoni.  A sequential deep learning application for recognising human activities in smart homes.  _Neurocomputing_ , 396(2019):501–513, 2020.  ISSN 18728286.  doi:10.1016/j.neucom.2018.10.104.  URL https://github.com/danielelic/deep-casas/.
  * Guan and Plötz [2017] Yu Guan and Thomas Plötz.  Ensembles of Deep LSTM Learners for Activity Recognition using Wearables.  _Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies_ , 1(2):1–28, 2017.  ISSN 2474-9567.  doi:10.1145/3090076.
  * Schaul and Schmidhuber [2010] Tom Schaul and Juergen Schmidhuber.  Metalearning.  _Scholarpedia_ , 5(6):4650, 2010.  doi:10.4249/scholarpedia.4650.
  * Grefenstette et al. [2019] Edward Grefenstette, Brandon Amos, Denis Yarats, Phu Mon Htut, Artem Molchanov, Franziska Meier, Douwe Kiela, Kyunghyun Cho, and Soumith Chintala.  Generalized Inner Loop Meta-Learning.  _arXiv_ , pages 1–17, 10 2019.  URL http://arxiv.org/abs/1910.01727.
  * Hendryx et al. [2019] Sean M. Hendryx, Andrew B. Leach, Paul D. Hein, and Clayton T. Morrison.  Meta-Learning Initializations for Image Segmentation.  _arXiv_ , 12 2019.  URL http://arxiv.org/abs/1912.06290.
  * Sun and Li [2021] Jiaxing Sun and Yujie Li.  MetaSeg: A survey of meta-learning for image segmentation.  _Cognitive Robotics_ , 1(May):83–91, 2021.  ISSN 26672413.  doi:10.1016/j.cogr.2021.06.003.
  * Adam et al. [2019] Stavros P. Adam, Stamatios Aggelos N. Alexandropoulos, Panos M. Pardalos, and Michael N. Vrahatis.  No free lunch theorem: A review.  _Springer Optimization and Its Applications_ , 145:57–82, 2019.  ISSN 19316836.  doi:10.1007/978-3-030-12767-1_5.
  * Hospedales et al. [2022] Timothy Hospedales, Antreas Antoniou, Paul Micaelli, and Amos Storkey.  Meta-Learning in Neural Networks: A Survey.  _IEEE Transactions on Pattern Analysis and Machine Intelligence_ , 44(9):5149–5169, 2022.  ISSN 19393539.  doi:10.1109/TPAMI.2021.3079209.
  * Cormen et al. [2009] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, and CLRS.  _Introduction to Algorithms, Third Edition_.  The MIT Press, 3rd edition, 2009.  ISBN 9780262033848.  doi:10.5555/1614191.
  * Cumin et al. [2017] Julien Cumin, Grégoire Lefebvre, Fano Ramparany, and James L. Crowley.  A Dataset of Routine Daily Activities in an Instrumented Home.  In _International Conference on Ubiquitous Computing and Ambient Intelligence_ , pages 413–425. -, 2017.  doi:10.1007/978-3-319-67585-5_43.  URL http://link.springer.com/10.1007/978-3-319-67585-5_43.
  * Hussain et al. [2020] Zawar Hussain, Quan Z. Sheng, and Wei Emma Zhang.  A review and categorization of techniques on device-free human activity recognition.  _Journal of Network and Computer Applications_ , 167:102738, 10 2020.  ISSN 10848045.  doi:10.1016/j.jnca.2020.102738.  URL http://arxiv.org/abs/1906.05074%0Ahttp://dx.doi.org/10.1016/j.jnca.2020.102738https://linkinghub.elsevier.com/retrieve/pii/S1084804520302125.
  * Bernard et al. [2018] Jürgen Bernard, Christian Bors, Markus Bögl, Christian Eichner, and Et.all.  Combining the Automated Segmentation and Visual Analysis of Multivariate Time Series.  _EuroVisWorkshop on Visual Analytics_ , 2018.  doi:10.2312/eurova.20181112.
  * Viard [2018] Kévin Viard.  _Modelling and Recognition of Human Activities of Daily Living in a Smart Home_.  PhD thesis, Université Paris-Saclay ; Politecnico di Bari. Dipartimento di Ingegneria Elettrica e dell’Informazione (Italia), 7 2018.  URL https://tel.archives-ouvertes.fr/tel-01867623.
  * Lu et al. [2021] Peng Lu, Baoye Song, and Lin Xu.  Human face recognition based on convolutional neural network and augmented dataset.  _Systems Science and Control Engineering_ , 9(S2):29–37, 2021.  ISSN 21642583.  doi:10.1080/21642583.2020.1836526.
  * Apple Inc. [2022] Apple Inc.  About Face ID advanced technology, 2022.  URL https://support.apple.com/en-us/HT208108.
  * Vanschoren [2019] Joaquin Vanschoren.  Meta-Learning.  In Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren, editors, _Automated Machine Learning: Methods, Systems, Challenges_ , pages 35–61. Springer International Publishing, Cham, 2019.  ISBN 978-3-030-05318-5.  doi:10.1007/978-3-030-05318-5_2.  URL https://doi.org/10.1007/978-3-030-05318-5_2http://link.springer.com/10.1007/978-3-030-05318-5_2.
  * Cook [2012] Diane J. Cook.  Learning Setting-Generalized Activity Models for Smart Spaces.  _IEEE Intelligent Systems_ , 27(1):32–38, 1 2012\.  ISSN 1541-1672.  doi:10.1109/MIS.2010.112.  URL http://ieeexplore.ieee.org/document/5567086/.
  * Eilers and Marx [1996] Paul H. C. Eilers and Brian D. Marx.  Flexible smoothing with B-splines and penalties.  _Statistical Science_ , 11(2):89–102, 5 1996\.  ISSN 0883-4237.  doi:10.1214/ss/1038425655.  URL https://projecteuclid.org/journals/statistical-science/volume-11/issue-2/Flexible-smoothing-with-B-splines-and-penalties/10.1214/ss/1038425655.full.
  * Finn et al. [2017] Chelsea Finn, Pieter Abbeel, and Sergey Levine.  Model-agnostic meta-learning for fast adaptation of deep networks.  _34th International Conference on Machine Learning, ICML 2017_ , 3:1856–1868, 2017.

##  Appendix A More details on the Used Datasets

Figure 11: Sensor Event Frequency in the First Part (12 of 24 activities) of
the Orange4Home Dataset. Each hit map indicates the frequency and distribution
of sensor events for an individual activity, with the Y-axis representing
specific sensors. The absence of events is shown in white, while darker tones
indicate higher event frequencies. These visual patterns reveal significant
differences in the occurrence and timing of sensor-triggered activities, such
as between ’Kitchen Cooking’ and ’Kitchen Cleaning’. Pre-segmented data
showcases distinct patterns, reducing ambiguity and enhancing recognition
performance of activities. Although valuable for experimental analysis, the
practicality of pre-segmented data in real-world scenarios may be limited.
Figure 12: Sensor Event Frequency for the remaining activities in the
Orange4Home Dataset, complementing Figure 11. Each hit map continues to
represent the frequency and distribution of sensor events, with darker shades
denoting more frequent occurrences. This part maintains the distinct activity
patterns identified in the first half, supporting the more straightforward
recognition of pre-segmented data across all 24 activities. Figure 13: The
standard routines in Orange4Home dataset [Cumin et al., 2018] Figure 14: Home1
Activity Duration Figure 15: Sensor Event Frequency for activities in the
Home1 Dataset. It shows the number of sensor events that occurred at each time
for each activity. On the legend, the average number of sensor’s heats are
shown. Figure 16: Home2 Activities Figure 17: Home2 Activity Duration Figure
18: Sensor Event Frequency for activities in the Home2 Dataset. It shows the
number of sensor events that occurred at each time for each activity. On the
legend, the average number of sensor’s heats are shown.