• No results found

Activity Recognition with Ontological Modelling Framework

UNCERTAINTIES KNOWLEDGE

1) OWL Contextual

6.3.2. Activity Recognition with Ontological Modelling Framework

The activity reasoning engine performs three main tasks to reason with 𝜎, πœ‹, and πœ™ knowledge. In the first task, the reasoning engine analyses each action within the activities at multi granularity level: coarse-grained action (π‘π‘Ž) and fine-grained (π‘“π‘Ž) as discussed in CHAPTER 4. The π‘π‘Ž activity level mainly considers attributes under which a given activity must be fulfilled. These attributes are location, time interval and key objects. The attributes for each activity are stored in the ontological model/graph-based database and can be queried using SPARQL Protocol and RDF query language (SPARQL) or description logic (DL) query approach, respectively. Furthermore, to detect missing actions or sensors for a given activity, aforementioned attributes are used to create a set of lists to describe mandatory/optional dependencies and 13 Allen rules to identify missing actions; more details in section 6.3.2.1. Secondly, the π‘“π‘Ž are analysed using πœ‹ model to detect incomplete actions from the set of actions described in the model. The fuzzy rules are used to combine multiple sensor data at a given time window and infer if the fuzzy state corresponds to π‘“π‘Ž. In addition, a set of π‘“π‘Ž are defined with importance weighting to calculate overall completion of an ADL using

fo:fuzzyLabel annotation and weightedSum concept type; further elaborated in section 6.3.2.2.

Thirdly, the uncertainty related to the events is taken into consideration based on attributes identified from task one to perform activity level uncertainty reasoning and action-specific uncertainty reasoning based on the result of task two. Section 6.3.2.3 provides further details in performing task three.

6.3.2.1. Detecting Missing Sensors

The mandatory actions or context events are those that are considered essential in order to conduct the activity and they follow specific sequences. To describe sequence dependencies in OWL, hasMandatoryDependences object property, is used within the class description of the ADL. For example, while making tea (𝐴1), the occupant must β€œstart” by picking up the kettle

FUZZY AND UNCERTAINTIES KNOWLEDGE

(𝐴) to fill up with a tap on (𝐡) and heat the water β€œbefore” turning the kettle switch (𝐢) on. On the other hand, optional actions are those that allow the occupant to conduct other actions without conducting the optional action. To describe optional sequences dependencies in OWL,

hasOptionalDependences object property, is used within the class description of the ADL. For

instance, the occupant may β€œstart” by opening the cupboard (𝐷) to take the tea mug out (𝐸) and spoon (𝐹) out; here during 𝐹 during 𝐷 or 𝐷 contains 𝐹 can be used. However, occupants may also pick up the mugs and spoon from the mug and cutlery stand by the kitchen sink/platform. Hence, opening cupboard (𝐷) action is defined as optional for 𝐴1.

Table 6.1. Example of Finding Missing Actions and Potential Sensor Failure. 𝐴1 (partial OWL class description): =

hasMandatoryAction some (𝐴 π‘œπ‘Ÿ 𝐡 π‘œπ‘Ÿ 𝐢 π‘œπ‘Ÿ 𝐸) hasOptionalAction some (𝐷 π‘œπ‘Ÿ 𝐹)

hasMandatoryDependences some ((𝐴 π‘ π‘‘π‘Žπ‘Ÿπ‘‘ 𝐡, 𝐡 π‘π‘’π‘“π‘œπ‘Ÿπ‘’ 𝐢), …) * hasOptionalDependences some ((𝐷 π‘ π‘‘π‘Žπ‘Ÿπ‘‘ 𝐸, 𝐷 π‘π‘œπ‘›π‘‘π‘Žπ‘–π‘›π‘  𝐹), …) Conducted action sequences: 𝐴𝐡𝐢𝐷𝐸𝐹

Observed event sequences: 𝐴𝐡𝐸𝐹

Following steps are taken to find missing actions/failed sensor: 1. Retrieve both types of dependencies for 𝐴1 activity 2. Check mandatory dependencies for 𝐴, 𝐡 and 𝐸.

o Mandatory action 𝐴 start 𝐡 OK. o Mandatory action 𝐡 before 𝐸 FAIL. o Mandatory action 𝐡 before 𝐢 EXPECTED. o Mandatory action 𝐡 before 𝐸 FAIL. 3. Check Optional dependencies for E and F

o Optional action 𝐡 before 𝐸 FAIL, o Optional action 𝐸 before 𝐹 FAIL. o Optional action 𝐷 contains 𝐸 EXPECTED. o Optional action 𝐷contains 𝐹 EXPECTED.

4. Check last message or request status from the sensors attached to 𝐢 and 𝐷 within the threshold amount? β†’ YES = missing action, NO = sensor failure

OWL Example:

*β„Žπ‘Žπ‘ π‘€π‘Žπ‘›π‘‘π‘Žπ‘‘π‘œπ‘Ÿπ‘¦π·π‘’π‘π‘’π‘›π‘‘π‘’π‘›π‘π‘’π‘  π‘ π‘œπ‘šπ‘’ ((((π‘ π‘‘π‘Žπ‘Ÿπ‘‘π‘  π‘ π‘œπ‘šπ‘’ 𝐴) π‘Žπ‘›π‘‘ π‘π‘’π‘“π‘œπ‘Ÿπ‘’ π‘ π‘œπ‘šπ‘’ 𝐡)), π‘Žπ‘›π‘‘ π‘“π‘–π‘›π‘–π‘ β„Žπ‘’π‘  π‘ π‘œπ‘šπ‘’ 𝐢))

In order to identify the missing sensors/actions, let us assume, both of the mandatory and optional example actions (𝐴-𝐹) are conducted sequentially and observed by the sensor network but failed to administer 𝐢 and 𝐷 actions. Hence, the observed 𝐴𝐡𝐸𝐹 sequences of events are analysed by retrieving both types of dependencies for A1 activity. The mandatory actions 𝐴 and 𝐡 satisfy Allen’s β€œstart” rule but fail to match any actions sequences between 𝐡 and 𝐸. The expected mandatory action is 𝐡 before 𝐢. However, it fails to see any mandatory dependencies between 𝐡 and 𝐸. The action 𝐸 is not part of any mandatory dependency sequences, hence optional dependencies are check for the rest of the events, 𝐸 and F. The optional dependencies sequences failed to match action link with B and 𝐸, 𝐸 and 𝐹. However, both 𝐸 and 𝐹 actions expected action 𝐷 to be conducted but missing from the observed sequences. The sensor event log can be further checked to see when the last message was received from the sensors attached

FUZZY AND UNCERTAINTIES KNOWLEDGE

to 𝐢 and 𝐷 objects when a given threshold or request status check in order to determine if the sensor active or failed. Table 4.6 describes the above kitchen scenario and the process of finding the missing sensors and potential sensor failures.

6.3.2.2. Detecting Incomplete Actions

The incomplete actions of one or more objects with multiple sensors observations are detected using fuzzy reasoning. The actions are observed and matched against a set of criteria at prior (or initial), present, and post states with fixed three-second window size. The set of criteria for prior state of action are used to detect changes at the end of the present state and the expected set of goals after having performed the action at post-state. For example, to detect β€œpouring” action, the prior state assumes that kettle is on the base and turned off, the kettle has some water (i.e., half the amount measured with picofarads (pF) value of 15), water temperature is very hot, and the cup is not full. As the user moves the kettle, the position (roll, yaw and pitch) is observed until the end of the present state time window and compare if the kettle has at least been moved and tilted in proportion to the half of the water amount (i.e., triangular function with (27.61, 20, 10) pF values). The fuzzy thresholds-based reasoning can help identify to what membership degree the movement of the kettle when half full fall under. The post-state of the action is to verify if the water level in the kettle has decreased, the cup has been filled (i.e., not empty) and the temperature was raised (i.e., hot or very hot). Likewise, other fine-grained actions such as β€œdrinking” from the cup are detected with relevant sensors. Figure 6.6 describes β€œpouring” and β€œdrinking” measurements at the initial and new state of the kettle and cup with sensors (i.e., liquid level, position data and object temperature) attached. In addition, a snapshot of fuzzy reasoning based on rules describing a set of criteria to be satisfied at three states is presented in Table 6.2.

Figure 6.6. Detecting incomplete actions by combining position and water level sensor to detect β€œpouring” actions

FUZZY AND UNCERTAINTIES KNOWLEDGE

Table 6.2. Example of detecting incomplete actions using fuzzy reasoning for pouring and drinking actions.

S Conditions

1 [kettle=on→kettle=off, kettle_liquid_pf=!empty, cup_liquid_pf !=full, kettle_obj_temp>=hot OR very hot] 2 Kettle pouring:

- IF liquid_pf >= full (30), THEN at least roll, yaw, pitch till half threshold amount (9.19, 20, 10). - IF liquid_pf (15) <= half (15), THEN at least roll, yaw, pitch till half threshold amount (27.61, 20, 10). - IF liquid_pf <= empty (8), THEN at least roll, yaw, pitch till half threshold amount (50.03, 20, 10). Cup filling:

- IF liquid_pf >= full (20), THEN at least roll, yaw, pitch till half threshold amount (20, 10, 5). - IF liquid_pf(10) <= half (10), THEN at least roll, yaw, pitch till half threshold amount (20. 10. 10). - IF liquid_pf <= empty (9), THEN at least roll, yaw, pitch till half threshold amount (30, 10, 15).

3 [kettle=off, liquid_pf<=half, cup_liquid_pf!=empty, cup_obj_temp AND kettle_obj_temp >= hot OR very hot]

Note: S: state, (1): prior, (2) present and (3) post

6.3.2.3. Uncertainty Reasoning at Activity and Action Level

The activity reasoning results from task one and two are used as evidence for probabilistic reasoning at the activity and action level. Therefore, SSBN is created based on the MTheory and MFrags defined in the PR-OWL model and evidences are mapped to relevant probabilistic distribution table which contains possible states and probabilistic values of occurring. These states include Boolean values in the PR-OWL and assumes fuzzy states of the sensor/object is reasoned in task two of the reasoning process. For instance, battery level of a given sensor is measured as 10%, the result from fuzzy reasoning in task two would be β€œlow” and this low value will be used as a piece of evidence for a given po2:DeclarativeProbability table, i.e., change probability value for the state of β€œlow” to 100% and others possible values in the table to 0%. The effected probability tables which depend on the sensor to function correctly in the SSBN will be propagated. Likewise, the collection of pieces of evidence is applied to the SSBN and the uncertainties defined at action/activity levels are calculated.