Analyzing Driver Behavior Compliance under HoS Regulations
Ignacio Vellido-Exp
´
osito, Juan Fern
´
andez-Olivares
a
, Ra
´
ul P
´
erez
b
and Luis Castillo
c
Department of Computer Science and AI, University of Granada, Andalusian Research Insitute in Data Science and
Computational Intelligence, Granada, Spain
Keywords:
Fleet Telematics, Regulation Compliance, Artificial Intelligence, Automated Planning.
Abstract:
World wide spreaded Hours of Service (HoS) regulations constraint drivers’ amount of working and driving
time without resting. Transport companies are extremely interested on interpreting what their drivers are
doing, based on the raw information of event logs generated by fleets’ onboard devices, considering the terms
defined by HoS regulations. This work addresses the problem of analyzing the compliance of a driver wrt
HoS, by using AI techniques to classify and label the information of a driver’s log according to HoS terms.
The final result is a human-interpretable descriptive model of driver behaviour that leverages the company
situational awareness, empowering staff responsible of operations to make better informed decisions.
1 INTRODUCTION
A problem of paramount importance in transport
companies is to determine whether driver activity
conforms with Hours of Service (HoS) regulation to
forestall illegal behavior and avoid costs due to sanc-
tions. HoS regulation are imposed by world wide
transport authorities (Meyer, 2011; Goel and Vidal,
2013), which constraint the amount of drivers’ work-
ing, driving and resting time when delivering a trans-
port service. As a consequence, scheduled driving
plans have to be aligned with laws that define the legal
behavior of a driver.
The widespread adoption of onboard IoT devices
in vehicle fleets enables recording the activity of
drivers in event logs. Moreover, transport companies
are encouraged (currently almost forced by law) to
endow every transport asset with electronic sensors
(i.e. tachographs) which record the different activ-
ities a driver performs when delivering a transport
service. This context enables driver activity to be
recorded in event logs and enhances the need for driv-
ing work plans to be monitored and analyzed either by
companies’ decision makers or authorities to analyze
drivers’ legal compliance. Since raw event logs gen-
a
https://orcid.org/0000-0002-7391-882X
b
https://orcid.org/0000-0002-1355-1122
c
https://orcid.org/0000-0002-4910-7752
This work is being partially funded by the Andalusian
Regional Project B-TIC-668-UGR20 and the Spanish Na-
tional Project RTI2018-098460-B-I00 with FEDER funds.
erated by onboard fleet devices are difficult to be di-
rectly interpreted, an important technical challenge is
to come up with easily interpretable descriptive mod-
els that help understand the huge amount of informa-
tion stored in such event logs.
In response to this need, the paper presents a
method that starting from a raw, real event log ex-
tracted from a tachograph, 1) classifies and tags activ-
ities, and 2) generates a human-interpretable descrip-
tive model that consists of an extension of the original
raw log with additional attributes that, after the clas-
sification and labeling process, characterize each and
every activity in the log.
The characterization provides a semantics to the
raw log by extending it with additional information
about aspects such as the type of activity according
to HoS regulation, the type of HoS sequence/subse-
quence the activity belongs to, as well as whether the
activity (and hence the sequence which it is involved
in) is compliant with the HoS regulation. The method
is validated with an experimentation over real data
and by a proof of concept.
This method provides several advantages. On the
one hand, operational staff can determine at a glance
information about the legality of driver’s behavior,
without the need to resort on a burdensome inspec-
tion of the raw log. On the other hand, the extended
log (descriptive model) incorporates information with
sufficient granularity to interpret what each of the
drivers is doing considering HoS regulations. In sum-
mary, the labeled event log can be easily interpreted
Vellido-Expósito, I., Fernández-Olivares, J., Pérez, R. and Castillo, L.
Analyzing Driver Behavior Compliance under HoS Regulations.
DOI: 10.5220/0011116200003191
In Proceedings of the 8th International Conference on Vehicle Technology and Intelligent Transport Systems (VEHITS 2022), pages 463-470
ISBN: 978-989-758-573-9; ISSN: 2184-495X
Copyright
c
2022 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
463
Figure 1: A summary of HoS concepts, duration and additional constraints. We make use of < and <= symbols to
indicate whether the allowed duration is represented by either an open or closed interval, respectively.
Figure 2: Hierarchical relations and structure of the differ-
ent types of sub-sequences, extracted from (Meyer, 2011).
by company experts which can make more informed
decisions considering either the historical or current
labeled situation of a driver.
The remainder of this paper shows, firstly, a de-
tailed description of the novel problem addressed and
the main contribution of the approach (Section 2).
Then, we outline the overall methodology (Section
3), and explain some background concepts needed to
ease the overall description of the approach (Section
4). The technical details are shown in Sections 5 and
6. We end with an experimentation conducted over a
proof of concept of the application (Section 7), and
discuss related and future work (Sections 8 and 9).
2 HoS REGULATION
Transport companies are interested on making deci-
sions to govern the behavior of their drivers by pre-
dicting whether a driver is close to committing a regu-
lation violation, but previous to this they have to face
the challenge of characterizing drivers according to
their driving style with respect to the HoS regulation.
With the incorporation of IoT onboard devices, com-
panies are forced to deal with large data volumes of
daily event logs, with thousands of events, that need to
be interpreted with respect to HoS regulations. There-
fore, there is a clear need for an expert to directly in-
terpret what a driver has been doing during the period
of time encompassed by a given event log.
Concretely, every event in an activity log is a tu-
ple (a, start, end, dur, d id), where each component
refers to: activity identifier (a), event start (start)
and end (end) times, event duration (dur), and driver
identifier (d id), respectively. A value for a is any
of the labels [Driving, Other, Pause, Idle] meaning
that the driver is either Driving, performing Another
Work, at Pause or Idle during dur minutes, between
start and end. Our goal is to provide semantics to
each event, by completing this raw information with
additional attributes whose values are the terms pro-
vided by the HoS regulation, which are detailed in the
following.
This regulation has been extensively analyzed in
(Goel and Vidal, 2013; Meyer, 2011). It is applied in
several countries, but in this work we focus on the Eu-
ropean Union regulation (EC) No 561/2006 (Meyer,
2011). The basic terms refer to four types of driver
activities as break (short period for recuperation), rest
(period at driver free disposal with enough time to
sleep), driving (time during which the driver is op-
erating a vehicle) and other work (time devoted to
any work except driving, like loading). These ac-
tivities do not exactly correspond to the event labels
above defined, but they are defined according to such
events and their attributes. That is to say, the regula-
tion defines different types of rest and break periods
(see Figure 1, left-hand table) according to the dura-
tion of a Pause event. Moreover, there are different
types of driving sequences. A basic driving sequence
is composed of a totally ordered set of the elements of
[Driving, Pause, Other, Idle] constrained to the dura-
tion of any Pause is less than 15 minutes (see Figure 1,
right-hand table for more types). More constraints are
defined over the duration of the rests and breaks, and
over the accumulated duration of driving sequences
(see both tables in Figure 1). The regulation provides
a set of basic and optional rules, should the former
not be satisfied, thus allowing more flexibility to gen-
erate and interpret driving schedules under such con-
straints. For example, either a break of 45 mins has to
VEHITS 2022 - 8th International Conference on Vehicle Technology and Intelligent Transport Systems
464
be taken after 4.5 hours of accumulated driving or the
break can be taken splitted in two parts of at least 15
mins and 30 mins respectively. This feature is good
for drivers since it provides flexibility to their work,
but complicates the interpretability of what they are
doing. Regulations also define additional constraints
(for example, the maximum number of occurrences of
a reduced rest in a weekly driving period), or the hi-
erarchical relationship between the different types of
sub-sequences, as well as their internal structure (see
Figure 2).
2.1 The Problem
In summary, the problem consists of classifying and
labeling events of a given log by considering the legal
terms above described about HoS regulations. Con-
cretely, the observed behavior has to be tagged in
terms of driving periods, daily driving periods (and
their types), and weekly driving periods (and their
types) as shown in Figures 1 (right-hand table) and
2. Last but not least, identified subsequences have to
be tagged as legal or illegal according to their compli-
ance with HoS regulation.
The main contribution of this work consists of ad-
dressing the above described labeling of activities and
classification of illegal sequences as a parsing process
based on automated planning (AP) techniques, as well
as an experimentation that validates our approach. AP
is a widely known field of Artificial Intelligence de-
voted to develop algorithms, called planners, that im-
plement search-based problem solving processes to
determine a plan (sequence of actions) for a situated
agent to achieve a goal. The inputs provided to a plan-
ner are a model of actions that describes the behavior
of the agent, called a planning domain, and, a plan-
ning problem, a description of the current state of the
agent and the goal to be achieved.
The main use of these techniques is the generation
of plans, but recent works have shown their usefulness
to recognize sequences of actions. This last use lays
on the fact that when a planner is provided with an
initial state that incorporates a sequence of observa-
tions representing the past activities of an agent, and
a repertory of possible goals the agent is intended to
achieve, the planning process can be used to deter-
mine which of the possible goals is intended to be
achieved by the agent executing the observed actions.
This view of automated planning is called plan recog-
nition and it is the one followed by our approach.
Concretely we are using in this work temporal hi-
erarchical task network planning techniques (tempo-
ral HTN), a variant of AP where the planning do-
main is represented as a hierarchical knowledge base
in which the behavior of the agent is defined in terms
of a compositional hierarchy of tasks/subtasks where
primitive tasks represent temporally annotated actions
to be executed by the agent, and compound tasks rep-
resent temporal ordering strategies of actions. The
key aspect in HTN is that compound task can be de-
composed in alternative ways by means of methods.
A method is a pair (t, d) that describes one way to
achieve the task t is to perform the tasks specified
in the task network d, a temporally constrained set
of tasks/subtasks representing things that need to be
done. The hierarchical planning process is based on
a search process that starts at a given top-level task
network, and recursively reduces it by opportunisti-
cally applying methods. The current task network is
transformed step by step in each reduction by insert-
ing tasks according to the order and temporal con-
straints specified in the methods, until it consists of
a plan only composed of primitive actions.
The reason to use a temporal and hierarchical
planning approach is two-fold: on the one hand, the
event log observations are temporally annotated and
constrained, hence we need to resort on a technique
able to manage such temporal constraints. On the
other hand, the HoS regulation can be naturally rep-
resented as a hierarchy of temporal tasks.
In our case a given event log represents a se-
quence of temporally annotated observations and the
planning process 1) identifies different temporal sub-
sequences of a driver’s daily and weekly driving ac-
tivity, 2) labels them according to the terms defined by
HoS regulation, and 3) classifies them as legal/illegal.
It is important to note that the identification of tempo-
ral sub-sequences is a process analogous to grammar
parsing, and in our case is addressed as a knowledge-
driven search process with two main features: i) it is
implemented in a hierarchical planner, ii) the planner
is provided with a knowledge-based model represent-
ing the HoS regulation. The parsing task is performed
over the entire event log considering that the decom-
position methods provided in the HTN model can be
seen as a set of production rules of an attribute gram-
mar.
In the following sections we describe the gen-
eral steps of our method, provide a description of
the knowledge-based representation of HoS regula-
tion, then we briefly describe the knowledge-driven
search process to parse the log, and the experimenta-
tion and proof of concept carried out to validate our
approach.
Analyzing Driver Behavior Compliance under HoS Regulations
465
Figure 3: A schema of the methodology of the approach.
3 OVERALL METHODOLOGY
The methodology we have followed to provide a so-
lution to the problem consists of the following steps
(see Figure 3):
1. Formalizing HoS rules as productions of an at-
tribute grammar.
2. Transforming the raw event log into a sequence of
temporal observations.
3. Parsing the sequence of temporal observations by
using the attribute grammar representing the HoS
regulation.
4. Generating a human-interpretable descriptive
model that consists of an extension of the origi-
nal event log with additional attributes
The following sections describe in detail these
steps.
4 HoS AS AN ATTRIBUTE
GRAMMAR
We have used attribute grammars (Knuth, 1968) as an
intermediate representation to formalize the descrip-
tion of the HoS regulation in Europe. The main reason
is that attribute grammars, apart from being an excel-
lent mechanism to describe context-sensitive gram-
mars, allow to easily represent the required temporal
and numeric constraints with grammar attributes. An
attribute grammar extends productions with seman-
tic rules
1
of the form {hconditionihassignmentsi},
where hconditioni defines the applicability conditions
of the production and hassignmentsi define how syn-
thesized attributes of parent nonterminals (at left-hand
side of the production) are calculated from attributes
of the right-hand side of the production. In the fol-
lowing we describe the production rules to recognize
basic breaks, rests and basic sequences (as described
previously).
1
We are using an ad hoc syntax for attribute grammar
in order to ease the explanation.
4.1 Recognizing Breaks, Rests and
Basic Sequences
The terminals of the grammar are the labels
[D, O, P, I], since they are used to distinguish the types
of observations which may be found in an event log
(Driving, Other, Pause, Idle). Terminals have asso-
ciated attributes such as duration that are represented
following the ”dot” notation. For example P.dur rep-
resents the duration of a concrete, recognized Pause
event in the event log. On the other hand, every non-
terminal has associated two attributes that represent
the driving time (attribute dt) and pausing time (at-
tribute rt) of the current recognized token. For exam-
ple, b
t1.rt represents the pausing time of the token
b t1 which in turn represents a Break of Type 1 (see
BREAK T1 in Figure 1).
Breaks Recognition. The pausing time of any pause
event in the log is further used to discriminate be-
tween different types of Breaks or Rests, according
to rules in Figure 1 (left-hand table). For example, a
production that recognizes a Break of Type 1, is rep-
resented as follows
b_ t1 : P {( a nd ( P . dur >= 45 min )( P. dur < 3 h rs )
( b _t 1 . rt := P. du r )
describing that a Break of Type 1 corresponds to a
pause greater than 45 minutes and lesser than 3 hours,
and that the duration of such pause event P.dur is as-
signed as the duration of the break b t1.rt . Other
types of breaks are represented in a similar way with
grammar productions.
Rests Recognition. Daily and weekly rests, repre-
sented by the non-terminal symbols rd and rw, may
be normal or reduced, and are defined according to
the duration of pauses described in Figure 1 (left-hand
table). For example, the following productions repre-
sent this aspect of the regulation
rd : rd _no r mal { r d . rt := rd _no r mal . rt };
rd : rd _ red u ced { rd . rt := rd _ red u c ed . rt };
rd_ n orm al : P {( and (P. du r >= 11 h ) (P . dur < 24 h )
( r d _no r mal . rt := P . dur ) } ;
VEHITS 2022 - 8th International Conference on Vehicle Technology and Intelligent Transport Systems
466
The first production describes the legal types of
daily rests, while the second represents that a normal
daily rest is a pause with a duration between 11 and
24 hours.
Basic Sequences Recognition. Figure 1 (right-hand
table) shows that a basic sequence is composed of
any number of activities such that the duration of any
Pause is strictly less than 15 mins. Firstly, we need
to define the legal activities allowed, which is repre-
sented by the non-terminal symbol elt and the fol-
lowing productions:
el t : D {( el t . dt := D . dur ; e lt . rt := 0)} ;
el t : P {( P . dur < 15 mins ) ;
( elt . dt := 0; elt . rt : = P. dur ) };
el t : O {( el t . dt := elt . dt := 0)};
el t : I {( el t . dt := elt . dt := 0)};
Then we can make use of the following recursive
production to define what a correct basic sequence
is. Moreover, it defines that the driving time of a se-
quence is the accumulated driving time of its compo-
nents. Note that in attribute grammars occurrences of
the same symbol are differentiated by subscripts to be
correctly identified.
ba seq : el t {( ba seq . dt := elt . dt )};
ba seq : el t bas eq
2
{( bas eq . dt := e lt . dt + bas eq
2
. dt )} ;
Finally the production rules to recognize the re-
maining HoS concepts described in Figure 1 are rep-
resented following the same principles illustrated pre-
viously.
5 GENERATING TEMPORAL
OBSERVATIONS
Every record of the event log is translated into
an observation (a, i, type, start, end, dur, d id)
where i is an index representing the order in the
sequence of events, a is a unique identifier for
the action, type indicates the type of action (one
of [D, O, P, I] corresponding to the actions labels
[Driving, Other, Pause, Idle]), d id is the identifier of
the driver, and start, end, dur represent the start and
end times of the action and its duration, respectively.
For example the event representing a Pause of 68 min-
utes from 15:46 to 16:54 on 05/01/2017 would be
represented as follows:
Event:
( P aus e " 0 5/0 1 /20 1 7 15 :46 "
"05 / 01/ 2 017 16 : 54 " 68 driv e r1 )
Observation:
( P15 39 P "0 5 / 01/ 2 017 15 : 46 "
"05 / 01/ 2 017 16 : 54 " 68 d r ive r1 )
6 PARSING PROCESS
Algorithm 1: Algorithm for classifying and labeling
based on event log parsing.
Input: G (productions), S (observations)
1 A [top level symbol] /*the agenda*/;
2 Π [] /*empty plan*/;
3 i 1 /*index of current event*/;
4 current event S [i];
5 Initialize contexts (Week, Day, DayType,
SeqOrder, SeqType, Token, Legal);
6 while A not empty do
7 extract the first element t from A;
8 if t is TERMINAL then
9 if type of action(current event) is in [D O
P I]) then
10 if not Check temporal constraints()
then
11 Insert event in Π as ILEGAL
temporal action
12 else
13 Insert event in Π as temporal
action;
14 Label the action with contexts;
15 current event S [i++];
16 else
17 Insert in Π event as ILEGAL
18 if t is NONTERMINAL then
19 LEGAL Y ES;
20 Update contexts considering t;
21 if t is UPDATE
t
then
22 update t.att according to t.successor
23 else
24 Choose from G one production t:rh
i
not yet processed (rh
i
={t
1
.. t
n
});
25 if All productions already processed
then
26 LEGAL NO
27 else
28 t.successor rh
i
;
29 A A {t
1
.. t
n
UPDATE
t
}
30 return Π with the labeled and classified actions
The algorithm of the parsing process is shown in Al-
gorithm 1. The algorithm receives as input the set
of productions representing the HoS regulation (the
grammar G) and the set of temporal observations S
(generated as above explained), and returns a plan Π
that contains the temporal observations transformed
in actions which are labeled with appropriate values
for the set of extended attributes [week day DayType
SeqOrder SeqType Token Legal] whose semantics is
described in subsections below. The first steps of the
algorithm consist of initializing the agenda A, that is a
list containing the pending productions (or compound
tasks) to be processed, the plan Π that is incremen-
Analyzing Driver Behavior Compliance under HoS Regulations
467
tally generated as events are processed, the index i
that refers to the current event to be processed in the
log, and the extended attributes.
The main loop of the algorithm explores the set of
productions of the grammar G trying to match gram-
mar productions with the current event of the log (in-
dexed by the variable i). If for the current event to be
processed a matching with a terminal of a legal pro-
duction is found, the event is transformed in an action,
added to the plan Π (if the temporal constraints of
the temporal observation are consistent with the cur-
rent plan), and labeled accordingly. This parsing pro-
cess is carried out over the entire set of observations
in S. The main steps are described in the following
sections.
6.1 Event Recognition
Each type of event [Driving, Other, Pause, Idle] has
an associated primitive temporal action htypei p in the
domain, that is instantiated according to event infor-
mation and added to the plan Π when the parsing has
processed an event of that type. Therefore, recogniz-
ing a concrete event that is at any given position i with
label type consists of adding its corresponding primi-
tive action to Π such that (i) the temporal points of the
action are consistent with the temporal information of
the event, and (ii) guaranteeing that the temporal con-
straints of a are consistent with the rest of temporal
constraints of the actions already added to the plan.
These conditions are checked by the planning process
itself.
The primitive tasks represent the ”token” (for ex-
ample, a Pause) that has been read, and the algorithm
describes in essence in Line 13 that a primitive task
(for example of type Pause) has to be added to the
plan Π when there is an observation of the same type
at the reading pointer position. Interestingly, the abil-
ity to represent temporal constraints on tasks at any
level of the hierarchy makes possible to represent that
the start and end points of the primitive action are
constrained by the temporal information of the ob-
servation (described in Section 5). This is the point
where temporal planning capabilities play a central
role since the algorithm will fail to classify the ac-
tion as ILEGAL (Line 11) if the temporal constraints
cannot be met. If the primitive task is successfully
inserted, the action is classified as LEGAL, and the
index of current event to be processed moves to the
next position. The labeling of actions performed in
Line 14 is explained in the following.
6.2 Labeling of Events
The labeling process accounts for the different time
resolution contexts, defined by HoS regulation, which
an event may belong to. Because of that, every event
in the event log is annotated with six labels
2
cor-
responding with six additional attributes with pro-
vide semantics to every event according to the fol-
lowing contexts: Week (integer values), Day (inte-
ger values) DayType (with possible values ndd or
edd, corresponding to the concepts of normal daily
driving and extended daily driving shown Figure 1),
SeqOrder (representing the order of appearance of a
sub-sequence as first, second or third), SeqType
(representing if an action belongs to a sub-sequence
of type splitted or continuous see Figure 1), token
( representing if the action is a break or a driving
action with possible values according to the types
of breaks in Figure 1 with the possible values b t1,
b t2, b t3, etc.). Finally, the last attribute Legal
describes if the activity has been classified by the
event recognition process as legal or illegal.
We have made extensive use of the features of the
attributes of every production in order to label records
of the event log. On the one hand, in Line 28 the set
of symbols for every non-terminal t is extended with
the special symbol {UPDATE
t
} for the algorithm to
be able to appropriately update the attributes of non-
terminals (Line 20). Moreover, a sequence is identi-
fied as ILEGAL (Line 26) when all the productions
for its non-terminal symbol have been processed and
no UPDATE symbol has been reached. On the other
hand, the set of attributes of every non-terminal is ex-
tended with as many attributes as described above.
7 EXPERIMENTATION
We have validated our methodology with an exper-
imentation using real tachograph logs provided by
an industrial collaborator. We were provided with a
dataset formed by two-weeks-long sequences of ac-
tivities from 290 different drivers.
Our experimentation consisted of splitting the
dataset by driver, transforming each associated log
into a set of observations. Additionally the algorithm
has been implemented using an off-the-shelf HTN
planner. The planner is provided with an HTN do-
main that has been written by translating the produc-
tions of the grammar representing the HoS regulation,
and setting the goal as recognising each action while
outputting the activities with the appropriate contexts.
2
We are assuming six labels and a reduced set of possi-
ble values for each label to ease the explanation.
VEHITS 2022 - 8th International Conference on Vehicle Technology and Intelligent Transport Systems
468
Table 1: Labelling output after processing a daily sequence. This example shows an extended driving period where the first
and second sequences contains split rests and the third is taken uninterrupted. The value ”A” in the Token column represents
any activity other than a Pause.
Original Log Annotated Labels
Driver Start End Duration Activity Week Day DayType Sequence BreakType Token Legal
driver3 12/01/2017 09:55 12/01/2017 09:57 2 Driving
3 6 edd
first
split 1
A yes
driver3 12/01/2017 09:57 12/01/2017 10:41 44 Break B T2 yes
driver3 12/01/2017 10:41 12/01/2017 10:43 2 Driving
split 2
A yes
driver3 12/01/2017 10:43 12/01/2017 11:57 74 Break B T3 yes
driver3 12/01/2017 11:57 12/01/2017 12:00 3 Driving
second
split 1
A yes
driver3 12/01/2017 12:00 12/01/2017 12:06 6 Break B T0 yes
driver3 12/01/2017 12:06 12/01/2017 12:08 2 Driving A yes
driver3 12/01/2017 12:08 12/01/2017 12:36 28 Break B T2 yes
driver3 12/01/2017 12:36 12/01/2017 13:07 31 Driving
split 2
A yes
driver3 12/01/2017 13:07 12/01/2017 13:13 6 Break B T0 yes
driver3 12/01/2017 13:13 12/01/2017 15:31 138 Driving A yes
driver3 12/01/2017 15:31 12/01/2017 15:39 8 Break B T0 yes
driver3 12/01/2017 15:39 12/01/2017 15:59 20 Driving A yes
driver3 12/01/2017 15:59 12/01/2017 18:00 121 Break B T3 yes
driver3 12/01/2017 18:00 12/01/2017 18:54 54 Driving
third uninterrupted
A yes
driver3 12/01/2017 18:54 12/01/2017 19:08 14 Break B T0 yes
driver3 12/01/2017 19:08 12/01/2017 19:09 1 Driving A yes
driver3 12/01/2017 19:09 12/01/2017 19:14 5 Other A yes
driver3 12/01/2017 19:14 13/01/2017 05:16 602 Break DR T2 yes
Once the system returned the labelled log, we selected
multiple sequences at random, both legal and illegal,
and manually verified that the output was the appro-
priate under the HoS regulation.
The additional labels provide an exact summari-
sation of the driver behaviour according to the HoS
regulation, resulting in a human interpretable descrip-
tive model, much more readable by experts and con-
sequently enabling business decisions based of tacho-
graph data, like assigning drivers to routes according
to their driving styles or identifying problematic ten-
dencies. Furthermore, because the system is capable
of identifying illegal sequences, a driver could obtain
immediate feedback after committing an infraction,
and therefore forestall future action that could result
in sanctions for the company.
Table 1 shows an output example for a daily driv-
ing sequence. As we can see, the original data is not
easily interpretable, since they are formed by differ-
ent patterns of Driving, Other and Break actions of
distinct duration. However, thanks to the annotated la-
bels the output becomes more informative and under-
standable, giving an overview of the driver behaviour
in multiple levels of granularity. In our example, it be-
comes more explicit that the driver carried out an ex-
tended daily driving with three sequences, where the
break of the first and second are taken in two parts,
and the break of the third sequence is taken uninter-
ruptedly at the end. Additionally, the last two columns
provide further information of how each action is con-
sidered under the regulation, and that none of them is
illegal.
Another example is shown in Table 2, display-
ing the response of our system against non legal se-
quences. As they do not fit correctly under the HoS
regulation, some contexts cannot be recognised and
they are labelled accordingly. Nevertheless, because
there could be legal subsequences belonging to a big-
ger illegal sequence, the architecture tries to label as
many contexts as possible to provide that additional
information. This functionality produces more under-
standable logs simplifying the process of pinpointing
the cause of the infraction.
8 RELATED WORK
The problem of generating driving plans compliant
with HoS regulations have already been addressed in
(Goel, 2018) and (Goel and Irnich, 2017), and HTN
planning can be considered an enabling technology
for this problem. However, we are using this planning
technique from a different perspective: recognizing
a preexisting temporal plan. As previously shown, a
key issue is to formalize the HoS regulation, and an al-
ternative formalization can be found in (Goel, 2018),
which is aimed to use classical scheduling techniques
to check the compliance of schedules (only plan ver-
ification) or to generate compliant schedules (plan
generation), but not suitable for the problem of plan-
goal recognition here addressed.
This application can be, in part, viewed as an in-
stance of Runtime Verification with Planning, where
Analyzing Driver Behavior Compliance under HoS Regulations
469
Table 2: Labelling output after encountering an illegal sequence. The system adds as many contexts as possible to ease the
interpretation of the sequence.
Original Log Annotated Labels
Driver Start End Duration Activity Week Day DayType Sequence BreakType Token Legal
driver1 11/01/2017 20:49 11/01/2017 20:50 1 Driving
2 10
unknown unknown
uninterrupted
A no
driver1 11/01/2017 20:50 11/01/2017 20:52 2 Other A no
driver1 11/01/2017 20:52 11/01/2017 23:06 134 Driving A no
driver1 11/01/2017 23:06 12/01/2017 00:00 54 Break B T1 no
driver1 12/01/2017 00:00 12/01/2017 03:00 180 Driving
unknown
A no
driver1 12/01/2017 03:00 12/01/2017 03:02 2 Other A no
driver1 12/01/2017 03:02 12/01/2017 03:03 1 Driving A no
driver1 12/01/2017 03:03 12/01/2017 03:06 3 Other A no
driver1 12/01/2017 03:06 12/01/2017 03:13 7 Driving A no
driver1 12/01/2017 03:13 12/01/2017 03:17 4 Other A no
driver1 12/01/2017 03:17 12/01/2017 06:30 193 Break unknown no
driver1 12/01/2017 06:30 12/01/2017 06:33 3 Driving
ndd unique uninterrupted
A yes
driver1 12/01/2017 06:33 14/01/2017 12:02 3209 Break WR T1 yes
regulations are expressed in a suitable formal lan-
guage, most often based on temporal logic, as de-
scribed in (Bensalem et al., 2014). This paper is in-
terestingly different, in that it encodes regulations in-
volving metric temporal constraints, expressed in an
attribute grammar. Our work is also related with con-
formance checking, in the area of Process Mining,
that consists of determining whether an executed pro-
cess conforms with a process model (Aalst, 2016).
Nevertheless, we do not only provide an answer to
whether a plan is or is not generated by a regulatory
model, but additionally our approach classifies sub-
sequences of the input plan and recognizes/identifies
them with concepts of the model, providing an inter-
pretation of the plan in such terms. Therefore, this
is a clear instance of a Plan-Goal Recognition (PGR)
problem that is traditionally addressed either by pro-
viding a plan library to represent the set of possible
plans to be recognized, or by representing the behav-
ior of the agent as a planning domain (also known as
PGR as Planning) (Ramırez and Geffner, 2009).
9 CONCLUSIONS
We have presented a method intended to provide sup-
port to experts on the task of interpreting what drivers
are or have been doing by recognizing their activity
recorded in an event log according to HoS regulations.
The main contribution is the proposal of a temporal
HTN-based approach to classify and label the activ-
ities in a real log where the plans observed are tem-
poral sequences of events, using an off-the-self tem-
poral HTN planner, with a domain generated from an
attribute grammar that describes de HoS regulation,
configured to recognize and classify the events ac-
cording to the goals represented as HTN tasks. The
novelty here is that the planning domain requires to
represent temporal and numerical information, and up
to authors’ knowledge there is no approach to which
fits that requirements. Another contribution is the for-
malization of concepts and constraints of the HoS reg-
ulation as an attribute grammar, a necessary step in
the knowledge engineering process proposed to rep-
resent the HTN domain.
REFERENCES
Aalst, W. v. d. (2016). Process Mining: Data Science in
Action. Springer-Verlag, Berlin Heidelberg, 2 edition.
Bensalem, S., Havelund, K., and Orlandini, A. (2014). Ver-
ification and validation meet planning and scheduling.
International Journal on Software Tools for Technol-
ogy Transfer, 16(1):1–12.
Goel, A. (2018). Legal aspects in road transport optimiza-
tion in europe. Transportation research part E: logis-
tics and transportation review, 114:144–162.
Goel, A. and Irnich, S. (2017). An exact method for vehicle
routing and truck driver scheduling problems. Trans-
portation Science, 51(2):737–754.
Goel, A. and Vidal, T. (2013). Hours of service regu-
lations in road freight transport: An optimization-
based international assessment. Transportation sci-
ence, 48(3):391–412.
Knuth, D. E. (1968). Semantics of context-free languages.
Mathematical systems theory, 2(2):127–145.
Meyer, C. M. (2011). European Legislation on Driving and
Working Hours in Road Transportation. In Meyer,
C. M., editor, Vehicle Routing under Consideration of
Driving and Working Hours: A Distributed Decision
Making Perspective, pages 9–24. Gabler, Wiesbaden.
Ramırez, M. and Geffner, H. (2009). Plan recognition
as planning. In Proceedings of the 21st interna-
tional joint conference on Artifical intelligence. Mor-
gan Kaufmann Publishers Inc, pages 1778–1783.
VEHITS 2022 - 8th International Conference on Vehicle Technology and Intelligent Transport Systems
470