with machine learning

unknownlippsAI and Robotics

Oct 16, 2013 (3 years and 10 months ago)

83 views

Posture recognition

with machine learning

Mitja Luštrek, Matjaž Gams


Jožef Stefan Institute

Department of Intelligent Systems


Task


Confidence EU project


monitor the
elderly to detect health problems



Input: 3 persons
×

45 recordings


12 body tags


3D coordinates


Noise: none, Ubisense
×

1,
×

2


Recognize six postures/activities


Standing/walking


Sitting


Lying


Sitting down


Lying down


Falling




Method


Manually segment and label recordings


Compute attributes from snapshots


Concatenate to create attribute vectors


Machine learning to train classifier

Attributes


reference

coordinate system


Z coordinates of tags


Absolute, z velocities of tags


Absolute, z distances between tags

Attributes


angles


Attributes


body coordinate system


All coordinates of tags


Velocities of tags

(absolute, direction)

One coordinate system

per snapshot

One coordinate system

per 1
-
second interval

Two options

Two more options: each coordinate system can use reference z axis

Options to explore


Attributes:


Reference coordinate system


Angles


One
-
per
-
snapshot body
coordinate system


One
-
per
-
interval body
coordinate system


One
-
per
-
snapshot body
coordinate system with
reference z


One
-
per
-
interval body
coordinate system with
reference z



Machine learning algorithms:


C4.5 decision trees


RIPPER decision rules


Naive Bayes


1
-
nearest neighbor


3
-
nearest neighbor


5
-
nearest neighbor


10
-
nearest neighbor


SVM


Random forest


Bagging


Adaboost M1 boosting

Protocol


Weka Experimenter (10
-
fold cross valifation, 10 repetitions)


1.
Test each set of attributes with each algorithm


Discard bad attributes and algorithms

2.
Test combinations of remaining attributes with remaining
algorithms


Select best combinations for best algorithms

3.
Tune algorithms

4.
Try attribute selection

5.
Decide on the winning method



3 and 4 in progress



1. Test each set of attributes with each algorithm

Ref.

Angles

Body

per
-
snap

Body

per
-
int

Body

per
-
snap

ref. z

Body

per
-
int

ref. z

C4.5 decision trees

89.8

80.4

87.7

88.5

89.7

89.5

RIPPER decision rules

87.8

80.5

85.2

86.4

88.3

88.7

Naive Bayes

84.9

77.3

80.9

81.9

85.3

83.5

1
-
nearest neighbor

94.2

90.9

73.8

72.8

75.7

73.2

3
-
nearest neighbor

94.7

91.9

77.1

74.8

78.6

76.3

5
-
nearest neighbor

94.2

91.5

78.8

76.7

80.1

77.1

10
-
nearest neighbor

93.2

90.1

78.9

77.6

81.1

77.1

SVM

96.2

86.6

89.0

90.1

91.7

91.8

Random forest

93.6

89.2

90.6

91.5

93.2

92.9

Bagging

93.6

88.3

92.0

92.5

93.3

92.9

Adaboost M1 boosting

93.8

87.3

91.7

91.9

93.0

92.7

Best
algorithm

Within 2 % of
best algorithm

Best
attributes

Within 2 % of
best attributes

Overall
best result

1. Test each set of attributes with each algorithm

Ref.

Angles

Body

per
-
snap

Body

per
-
int

Body

per
-
snap

ref. z

Body

per
-
int

ref. z

C4.5 decision trees

89.8

80.4

87.7

88.5

89.7

89.5

RIPPER decision rules

87.8

80.5

85.2

86.4

88.3

88.7

Naive Bayes

84.9

77.3

80.9

81.9

85.3

83.5

1
-
nearest neighbor

94.2

90.9

73.8

72.8

75.7

73.2

3
-
nearest neighbor

94.7

91.9

77.1

74.8

78.6

76.3

5
-
nearest neighbor

94.2

91.5

78.8

76.7

80.1

77.1

10
-
nearest neighbor

93.2

90.1

78.9

77.6

81.1

77.1

SVM

96.2

86.6

89.0

90.1

91.7

91.8

Random forest

93.6

89.2

90.6

91.5

93.2

92.9

Bagging

93.6

88.3

92.0

92.5

93.3

92.9

Adaboost M1 boosting

93.8

87.3

91.7

91.9

93.0

92.7

2. Test combinations of attributes after selection

Ref. + angles

Ref. +

body per
-
int


Ref. +

body per
-
snap ref. z


Angles +

body per
-
int

Angles +

body per
-
snap ref z.

All (per
-
int)

All (per
-
snap

ref z.)

3
-
nearest neighbor

94.7

92.7

91.3

85.4

85.3

93.1

91.9

SVM

96.3

95.0

95.3

91.6

92.5

95.2

95.4

Random forest

93.7

94.2

93.8

92.3

93.2

94.2

93.8

Bagging

93.7

94.2

94.1

92.9

93.4

94.2

94.2

Adaboost M1 boosting

93.1

93.9

93.7

92.4

93.1

93.9

93.7

Best
algorithm

Within 1 % of
best algorithm

Best
attributes

Within 1 % of
best attributes

Overall
best result

2. Test combinations of attributes after selection

Ref. + angles

Ref. +

body per
-
int


Ref. +

body per
-
snap ref. z


Angles +

body per
-
int

Angles +

body per
-
snap ref z.

All (per
-
int)

All (per
-
snap

ref z.)

3
-
nearest neighbor

94.7

92.7

91.3

85.4

85.3

93.1

91.9

SVM

96.3

95.0

95.3

91.6

92.5

95.2

95.4

Random forest

93.7

94.2

93.8

92.3

93.2

94.2

93.8

Bagging

93.7

94.2

94.1

92.9

93.4

94.2

94.2

Adaboost M1 boosting

93.1

93.9

93.7

92.4

93.1

93.9

93.7

Bagging

Attribute
selection

3
-
NN

SVM

3. Tune algorithms


3
-
nearest neighbor:


Changing no single parameter improves accuracy


SVM:


Changing no single parameter or combination of parameters
significantly improves accuracy


c = 1.0

c = 0.1 slightly improves accuracy


Bagging:


Iteration count = 10

20, 30 improves accuracy (not much, but
in some cases significantly)


Fast decision tree learner


C4.5 improves accuracy (also not
much, but in some cases significantly)


Tuning still in progress

4. Try attribute selection


Many options, inadequate documentation, slow


In progress

5.
Decide on the winning method


Best bet:


SVM


Attributes in reference coordinate system + angles


c = 0.1


Tuning of bagging unlikely to change this


We have yet to see what attribute selection can do

Questions?