
In such a case, the resulting overall system can be seen as
a combined approach (model-based for generating training
data, and model-free for the goal classification task) that out-
performs the pure model-based approach in terms of both
classification accuracy and classification runtime. Indeed, an
experimental analysis presented in the paper confirms that
GRNet achieves good performance in terms of both goal
classification accuracy and runtime, obtaining consistently
better performance with respect to a state-of-the-art goal
recognition system over a class of benchmarks in six plan-
ning domains.
In rest of paper, after giving background and preliminaries
about goal recognition and LSTM networks, we describe the
GRNet approach; then we present the experimental results;
finally, we discuss related work and give the conclusions.
Preliminaries
We describe the problem goal of recognition, starting with
its relation to activity/plan recognition, and we give the es-
sential background on Long Short-Term Memory networks
and the attention mechanism.
Activity, Goal and Plan Recognition
Activity, plan, and goal recognition are related tasks (Geib
and Pynadath 2007). Since in the literature sometime they
are not clearly distinguished, we begin with an informal def-
inition of them following (Van-Horenbeke and Peer 2021).
Activity recognition concerns analyzing temporal se-
quences of (typically low-level) data generated by humans,
or other autonomous agents acting in an environment, to
identify the corresponding activity that they are perform-
ing. For instance, data can be collected from wearable sen-
sors, accelerometers, or images to recognize human activi-
ties such as running, cooking, driving, etc. (Vrigkas, Nikou,
and Kakadiaris 2015; Jobanputra, Bavishi, and Doshi 2019).
Goal recognition (GR) can be defined as the problem of
identifying the intention (goal) of an agent from observa-
tions about the agent behaviour in an environment. These
observations can be represented as an ordered sequence of
discrete actions (each one possibly identified by activity
recognition), while the agent’s goal can be expressed either
as a set of propositions or a probability distribution over al-
ternative sets of propositions (each oven forming a distinct
candidate goal).
Finally, plan recognition is more general than GR and
concerns both recognising the goal of an agent and identi-
fying the full ordered set of actions (plan) that have been, or
will be, performed by the agent in order to reach that goal;
as GR, typically plan recognition takes as input a set of ob-
served actions performed by the agent (Carberry 2001).
Model-based and Model-free Goal Recognition
In the approach to GR known as “goal recognition over a do-
main theory” (Ram´
ırez and Geffner 2010; Van-Horenbeke
and Peer 2021; Santos et al. 2021; Sohrabi, Riabov, and
Udrea 2016), the available knowledge consists of an under-
lying model of the behaviour of the agent and its environ-
ment. Such a model represents the agent/environment states
and the set of actions Athat the agent can perform; typi-
cally it is specified by a planning language such as PDDL
(McDermott et al. 1998). The states of the agent and envi-
ronment are formalised as subsets of a set of propositions F,
called fluents or facts, and each domain action in Ais mod-
eled by a set of preconditions and a set of effects, both over
F. An instance of the GR problem in a given domain is then
specified by:
• an initial state Iof the agent and environment (I⊆F);
• a sequence O=hobs1, .., obsniof observations (n≥1),
where each obsiis an action in Aperformed by the agent;
• and a set G={G1, .., Gm}(m≥1) of possible goals of
the agent, where each Giis a set of fluents over F.
The observations form a trace of the full sequence πof ac-
tions performed by the agent to achieve the goal. Such a plan
trace is a selection of (possibly non-consecutive) actions in
π, ordered as in π. Solving a GR instance consists of identi-
fying the G∗in Gthat is the (hidden) goal of the agent.
The approach based on a model of the agent’s actions and
of the agent/environment states, that we call model-based
goal recognition (MBGR), defines GR as a reasoning task
addressable by automated planning techniques (Meneguzzi
and Pereira 2021; Ghallab, Nau, and Traverso 2016).
An alternative approach to MBGR is model-free goal
recognition (MFGR) (Geffner 2018; Borrajo, Gopalakrish-
nan, and Potluru 2020). In this approach, GR is formulated
as a classification task addressed through machine learning.
The domain specification consists of a fluent set F, and a set
of possible actions A, where each action a∈Ais specified
by just a label (a unique identifier for each action).
A MFGR instance for a domain is specified by an observa-
tion sequence Oformed by action labels and, as in MBGR,
a goal set Gformed by subsets of F. MFGR requires mini-
mal information about the domain actions, and can operate
without the specification of an initial state, that can be com-
pletely unknown. Moreover, since running a learned classi-
fication model is usually fast, a MFGR system is expected
to run faster than a MBGR system based on planning algo-
rithms. On the other hand, MFGR needs a data set of solved
GR instances from which learning a classification model for
the new GR instances of the domain.
Example 1 As a running example, we will use a very sim-
ple GR instance in the well-known BLOCKSWORLD domain.
In this domain the agent has the goal of building one or
more stacks of blocks, and only one block may be moved at a
time. The agent can perform four types of actions: Pick-Up
a block from the table, Put-Down a block on the table,
Stack a block on top of another one, and Unstack a block
that is on another one. We assume that a GR instance in
the domain involves at most 22 blocks. In BLOCKSWORLD
there are three types of facts (predicates): On, that has
two blocks as arguments, plus On-Table and Clear that
have one argument. Therefore, the fluent set Fconsists of
22 ×21 + 22 + 22 = 506 propositions. The goal set Gof
the instance example consists of the two goals G1={(On
Block F Block C),(On Block C Block B)}and G2=
{(On Block G Block H),(On Block H Block F)}; the