modeling and reasoning with problog: an application in … · 2018-03-26 · inferences (rockit). c...

24
Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt Modeling and Reasoning with ProbLog: An Application in Recognizing Complex Activities 1 19.03.2018

Upload: others

Post on 26-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Modeling and Reasoning with ProbLog:

An Application in Recognizing Complex Activities

119.03.2018

Page 2: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

19.03.2018

2Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Content

1. Motivation

2. Model & System

3. Preliminary Results

4. Discussion

5. Ongoing Work

CO

MO

REA@

PER

CO

M2

01

8

Page 3: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

MOTIVATION

19.03.2018 3Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Page 4: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

4

Scenario

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

We focus on recognizing complex activities like “watering plants” or “taking medicine”.

So far we relied on...

What we are targeting right now ...

... ontological and probabilistic reasoning(as it overcomes well-known limitations)

... online recognition and active learning

Page 5: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

5Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Scenario

Page 6: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

6

Motivation

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Until now we used Markov Logic Networks (RockIt) to model our scenario, but ...

... weights are not this intuitive as probabilities

We decided to investigate ProbLog in respect of Activity Recognition

... much computational effort

... did not support time-constraints and marginal inferences (RockIt).

Page 7: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

7

Idea

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

ProbLog is a probabilistic extension of Prolog which allows to explicitly define probabilistic facts and rules.

Segment sensor stream into windows

Build for each window a ProbLog program

Allows to query the user in almost real-time

“Marginal Inferences” allows to apply rules but also interpret the results across windows

Page 8: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

8

Contribution

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

We clarify the benefits of ProbLog for activity recognition

We introduce a guidance on how to write ProbLog programs.

We present a ProbLog-based method to recognize activities of daily living in an online fashion

We show potential advantages of ProbLog’s marginal inference

Page 9: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

MODEL & SYSTEM

19.03.2018 9Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Page 10: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

10Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

System

1. Extracting probabilities (sensor type ↔ activity)

2. Segmentation

3. ProbLog Program Generation

4. Online Activity Recognition

extracted from the dataset (supervised)

Standard windowing approach with a fixed size

As soon as a window is finalized we generate the ProbLog program

We choose the most likely activity

Page 11: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

11Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Building a ProbLog Program (1/4)

Event and Instance Clauses (Example)

1.0::event(e1, water, 5).

1.0::event(e2, absent, 6).

This implies that these two clauses have to be part of each possible world (ground truth).

0.5::instance(ai1, ac1, 0, 7); 0.5::instance(ai1, ac2, 0, 7).

0.5::instance (ai2, ac1, 4, 10); 0.5::instance(ai2, ac2, 4, 10).

XORe.g. cleaning predicate

Page 12: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

12Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Building a ProbLog Program (1/4)

Probabilistic Facts (Example)

Temporal Constraints (Example)

0.9::related(X, watering) :- event(X, water, T)

allows to incorporate mined probabilities

closeAfter(T1,T2) :- T1>T2,T3 is T1-T2, T3<3.

0.6::producedBy(X2,I) :- event(X1,Y1,T1), event(X2,Y2,T2),

closeAfter(T2,T1), producedBy(X1,I)

Intuitively, temporally close events more likely belong to the same activity instance.

Page 13: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

13Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Building a ProbLog Program (1/4)

Knowledge-based Facts (Example)

Domain Constraints (Example)

0.9::bond(Y, waterplants) :- event(X1, water, T1), event(X2,

can, T2), closeAfter(T1,T2), producedBy(X1,Y).

We assume that “can” is only used for “waterplants”

r1 :- related(e1, ac1), \+related(e1, ac2);

related(e2, ac1), \+related(e2, ac2);

evidence(r1,true).

We want to be sure that each sensor event is assigned to exactly one activity.

Page 14: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

14

An instance of our program

instance(ai1,ac1,0,7)

producedBy(e1,ac1)

related(e1, cleaning)

Executing a ProbLog Program

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

CA

3 X Y

1

A

1

X

Each of them has a probability

Probability of a certain program instance

The probabilities of all instances answer our query

We have toformulate a query

Page 15: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

PRELIMINARY RESULTS

19.03.2018 15Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Page 16: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

Dataset: CASAS

16Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

CASAS: A smart home in a box, D.J. Cook et al., 2013

Page 17: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

17

Results: Recognition Rate

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

The activities are well recognized but there is a gap between the worst and best result (ac1 vs. ac5)

0

0,1

0,2

0,3

0,4

0,5

0,6

0,7

0,8

0,9

1

ac1 ac2 ac3 ac4 ac5 ac6 ac7 ac8

F-m

eas

ure

Activities

Page 18: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

18

Results: Marginal Inference

This militates for the quality of the ranking but also for the reliability of the approach.

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

0,5

0,6

0,7

0,8

0,9

1

ac1 ac2 ac3 ac4 ac5 ac6 ac7 ac8

Top-1

Top-2

Top-3F-m

eas

ure

Activities

Page 19: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

19

Runtime

Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Computation time of a segment (seconds)

Cu

mu

lati

ve p

rob

abili

ty

Page 20: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

DISCUSSION

19.03.2018 20Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Page 21: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

21Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

The results look promising but ...

Discussion

... difficult to compare to existing works due to different setups

... only a standard windowing approach

... probabilities were extracted from the dataset

... Interleaved activities are not explicitly modeled

Page 22: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

ONGOING WORK

19.03.2018 22Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Page 23: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

23Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Ongoing Work

Our next steps are ...

... fully exploit marginal inferences

... investigating active learning for personalization (e.g. correcting/adapting probabilities)

refine the classification of the windows

Currently, in another work, we focus on suitable online and active learning techniques

Page 24: Modeling and Reasoning with ProbLog: An Application in … · 2018-03-26 · inferences (RockIt). C O M O R EA @P M 2018 19.03.2018 7 Idea Timo Sztyler, Gabriele Civitarese, Heiner

CO

MO

REA@

PER

CO

M2

01

819.03.2018

24Timo Sztyler, Gabriele Civitarese, Heiner Stuckenschmidt

Thank you for your attention :)