Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Perception: objects in the environment
Zsolt Vizi, Ph.D.
Robert Bosch Kft.
2018
Perception: objects in the environment Robert Bosch Kft.
Self-driving cars
Perception: objects in the environment Robert Bosch Kft.
Sensor fusion: one categorization
I Type 1: low-level/raw data fusioncombining several sources of raw data to produce new datathat is expected to be more informative than the inputs.
I Type 2: intermediate-level/feature level fusioncombining various features (e.g. positions) into a featuremap, which can be used for higher level decisions
I Type 3: high-level/decision fusioncombining decisions from several experts (e.g. voting,fuzzy-logic, statistical methods)
Perception: objects in the environment Robert Bosch Kft.
Perception: topics of this lecture
I Object tracking
I Object type classification
Perception: objects in the environment Robert Bosch Kft.
Tracking problems
I The basic tracking problem is to estimate the positionand velocity of the target(s), using the available sensordata (from a sequence of scans).
I The multi-target tracking problem is not simply atracking problem when there are more than one target →problem of associating measurements with targets.
Perception: objects in the environment Robert Bosch Kft.
Tracking problems vs. typical estimation problems
I Strong temporal component is involved.
I Estimation of quantities, which are expected to change overtime.
I Current state is interested.
I Current state is computed from previous states.
Perception: objects in the environment Robert Bosch Kft.
Bayesian inference
I Inference methods consist of estimating the current valuesfor a set of parameters based on a set of observations ormeasurements.
I Bayesian estimation: the parameters are randomvariables that have a prior probability and the observationsare noisy as well
Perception: objects in the environment Robert Bosch Kft.
Recursive Bayesian estimation
Source: http://slidedeck.io/robertsy/ensemble-da
Perception: objects in the environment Robert Bosch Kft.
Bayes theorem
p(x|z) =p(z|x)p(x)
p(z)
I X: target state (random vector variable);
I Z: observation (random vector variable);
I p(x) (probability density function of X): prior density;
I p(x|z): posterior density;
I p(z|x): likelihood function;
I p(z): normalization constant
p(z) =
∫Rnx
p(z|x)p(x) dx
I Notation: p(x, z) = joint density
Perception: objects in the environment Robert Bosch Kft.
Point estimators
In summary: we estimate densities at each steps... How do weuse it in a specific tracking problem? → ’Mapping’ the densityinto real world: point estimator xProcedure
1. Define cost function L(x, x), which defines a penalty for anerroneous estimate x 6= x. Typical choice:
L(x, x) = (x− x)TM(x− x).
2. Bayesian risk R:
R = E (L(x, x)) =
∫Rnx
L(x, x)p(x)dx
Note: x = x(z). Optimal choice:
x(z) = argminx∗(z)
∫Rnx+nz
L(x∗(z), x)p(x, z) dx dz
Perception: objects in the environment Robert Bosch Kft.
Point estimators
In summary: we estimate densities at each steps... How do weuse it in a specific tracking problem? → ’Mapping’ the densityinto real world: point estimator xProcedure
3. Using first derivative, we get [homework]
x(z) = E(x|z)
4. Uncertainity for this estimation:
Pxx = E((x− x)(x− x)T |z)
Perception: objects in the environment Robert Bosch Kft.
Dynamic and sensor model
We focus on first-order Markov processes (current state isdependent only on the previous state).
1. System dynamic model:
xn = fn−1(xn−1) + un + vn−1
I xn: state vector at time tnI fn−1: deterministic transition functionI un: known deterministic controlI vn−1: additive noise
Perception: objects in the environment Robert Bosch Kft.
Dynamic and sensor model
We focus on first-order Markov processes (current state isdependent only on the previous state).
2. Sensor model:zn = hn(xn) + wn
I zn: current observation vectorI hn: deterministic observation functionI wn: additive noise
Simplifying assumption: fn and hn are adiabatic (changing veryslowly in time) → fn = f , hn = h
Perception: objects in the environment Robert Bosch Kft.
Recursive Bayesian filtering
Notation: z1:n = {z1, z2, . . . , zn} (observations up to nth step)Goal: estimating p(xn|z1:n) → applying Bayes theorem:
p(xn|z1:n) =p(z1:n|xn)p(xn)
p(z1:n)
After some calculations, we obtain
p(xn|z1:n) =p (zn|xn) p (xn|z1:n−1)
p (zn|z1:n−1)
Using Chapman-Kolmogorov equation for p (xn|z1:n−1), wederive
p (xn|z1:n−1) =
∫Rnx
p(xn|xn−1)p(xn−1|z1:n−1) dxn−1
Perception: objects in the environment Robert Bosch Kft.
Recursive Bayesian filtering
Perception: objects in the environment Robert Bosch Kft.
Back to the point estimators: a notation
State estimation:xn|p = E{xn|z1:p}
Uncertainity estimation:
Pxxn|p = E
{(xn − xn|p)(xn − xn|p)T |z1:p
}
Perception: objects in the environment Robert Bosch Kft.
Back to the point estimators: prediction
More algebraic manipulation (combining previous formulae,system dynamic model) give:
xn|n−1 =
∫Rnx
{fn−1(xn−1) + un + vn−1} p(xn−1|z1:n−1)dxn−1
and
Pxxn|n−1 =
∫Rnx
{fn−1(xn−1) + un − xn|n−1
}×{
fn−1(xn−1) + un − xn|n−1}T ×
p(xn−1|z1:n−1)dxn−1 +Q,
where Q is the covariance matrix of the system noise:
Q =
∫Rnx
vn−1vTn−1p(xn−1|z1:n−1)dxn−1
Perception: objects in the environment Robert Bosch Kft.
Back to the point estimators: update [by Kalman]
xn|n = Azobsn + b
Assumption:I E(xn − xn|z1:n−1) = 0I E((xn − xn)zobsn |z1:n−1) = 0
Goal #1: Determine A, bSome calculations give
b = xn|n−1 −Azn|n−1and
A = Kn = P xzn|n−1
(P zzn|n−1
)−1which implies
xn|n = xn|n−1 +Kn(zobsn − zn|n−1)P xxn|n = KnP
zzn|n−1K
Tn
Perception: objects in the environment Robert Bosch Kft.
Back to the point estimators: update [by Kalman]
Goal #2: Determine zn|n, Pxzn|n−1, P
zzn|n−1
zn|n =
∫Rnx
{hn(xn) + wn}p(xn|z1:n−1)dxn,
P xzn|n−1 =
∫Rnx
{xn − xn|n−1}{hn(xn)− zn|n−1}T p(xn|z1:n−1)dxn,
P zzn|n−1 =
∫Rnx
{hn(xn)− zn|n−1}{hn(xn)− zn|n−1}T×
p(xn|z1:n−1)dxn +R
where covariance matrix of observation noise is
R =
∫Rnx
wnwTn p(xn|z1:n−1)dxn
Perception: objects in the environment Robert Bosch Kft.
Recursive point estimation process
Perception: objects in the environment Robert Bosch Kft.
Gaussian densities: Kalman filters
I Linear KF: f , h linear
I Extended KF: f , h nonlinear + Taylor approximation
I Finite Difference KF: f , h nonlinear + Stirlingapproximation
I Unscented KF: f , h nonlinear + sigma points: onhypersphere in all directions
I Spherical Simplex KF: f , h nonlinear + sigma points:on intersection of simplex & hypersphere
I Gaussian-Hermite KF: f , h, nonlinear + sigma points:vertices of hypercube
I Monte Carlo KF: f , h nonlinear + MC sampling
Perception: objects in the environment Robert Bosch Kft.
Kalman Filters
Source: https://www.mathworks.com/videos/understanding-kalman-filters-part-1-why-use-kalman-filters–1485813028675.html
Perception: objects in the environment Robert Bosch Kft.
LKF
System dynamic model:
xn = Fxn−1 + vn−1
Sensor model:zn = Hxn + wn
All densities are Gaussian:
N (x;m,C) =1√
(2π)ndet(C)exp
{−1
2(x−m)C−1(x−m)T )
}
I p(xn|z1:n) = N (xn; xn|n, Pxxn|n)
I p(qn|z1:n−1) = N (qn; qn|n, Pqqn|n−1)
I p(zn) = N (zn; zn|n, Pzzn|n−1)
Perception: objects in the environment Robert Bosch Kft.
LKF
Using these assumptions, we obtain:
1. Prediction:xn|n−1 = Fxn−1|n−1,
P xxn|n−1 = FP xx
n−1|n−1FT +Q
2. Observation prediction/likelihood:
zn|n−1 = Hxn|n−1,
P zzn|n−1 = HP xx
n|n−1HT +R,
P xzn|n−1 = P xx
n|n−1HT
Perception: objects in the environment Robert Bosch Kft.
LKF
Using these assumptions, we obtain:
3. Update:
Kn = P xzn|n−1
(P zzn|n−1
)−1xn|n = xn|n−1 +Kn
(zobsn − zn|n−1
),
P xxn|n = P xx
n|n−1 −KnPzzn|n−1K
Tn ,
Perception: objects in the environment Robert Bosch Kft.
An example [finally...]
State vector:
xn =[pn vn
]=[position velocity
]Constant velocity model:
F =
[1 dt0 1
]System noise:
vn−1 ∼ N (0, Q)
Observation model (sensor output: noisy measurement forposition):
H =[1 0
]Measurement noise:
wn−1 ∼ N (0, σ2)
Perception: objects in the environment Robert Bosch Kft.
An example [finally...]
(http://david.wf/kalmanfilter/)
Perception: objects in the environment Robert Bosch Kft.
Another example
Simo Sarkka, Bayesian Filtering and Smoothing, CambridgeUnversity Press, 2013
Figure: Chapter 4.3, Example 4.3
Perception: objects in the environment Robert Bosch Kft.
Some words about multi-target tracking problem
I Nearest Neighbors FilterI Probabilistic Data Association FilterI Multihypothesis Filter
More details: http://ais.informatik.uni-freiburg.de/teaching/ws10/robotics2/pdfs/rob2-15-dataassociation.pdf
Perception: objects in the environment Robert Bosch Kft.
Non-Gaussian densities: Particle Filters
Explanation without equations:https://www.youtube.com/watch?v=aUkBa1zMKv4
Tutorial with a bunch of equations:Doucet A., Johansen A.M., A Tutorial on Particle Filtering andSmoothing: Fifteen years later
Perception: objects in the environment Robert Bosch Kft.
References
1. Anton J. Haug, Bayesian Estimation and Tracking: APractical Guide, Wiley, 2012
2. Sudha Challa et. al, Fundamentals of object tracking,Cambridge University Press, 2011
Perception: objects in the environment Robert Bosch Kft.
Classification problems
The problem of identifying to which of a set of categories(sub-populations) a new observation belongs, on the basis of atraining set of data containing observations (or instances)whose category membership is known.
Perception: objects in the environment Robert Bosch Kft.
Classification problems
I Supervised learning: learning where a training set ofcorrectly identified observations is available (MachineLearning)
I Feature/Explanatory variable/Independentvariable: quantifiable property, which is used in therepresentation of the observation
I Category/Outcome/Dependent variable/Targetvariable/Class/Response variable: e.g.spam/not-spam
I Classifier: classification algorithm
I Binary and multiclass classification: two and moreclasses are involved
Perception: objects in the environment Robert Bosch Kft.
Classification vs. ’estimation’
I Many classifiers output simply the ’best class’ as an answer
I Probabilistic classifiers/estimators return a probability ofthe instance being a member of each of the possible classes→ ’best class’ is naturally the one with the highestprobability
I Advantages of probabilistic methods:I probability = confidence valueI efficient in large-scale problems, because error-propagation
can be avoided
Perception: objects in the environment Robert Bosch Kft.
General Linear Models
GLMLarge class of models, where the response variable is assumed tofollow an exponential family distribution and this variable is a(typically nonlinear) function of the linear combination offeature values.
Perception: objects in the environment Robert Bosch Kft.
General Linear Models
Exponential family
p(x) = h(x) exp{ηTT (x)−A(η)
}More details:https://people.eecs.berkeley.edu/ jordan/courses/260-spring10/other-readings/chapter8.pdf
Examples for family members
I Bernoulli distribution: X ∈ {0, 1};P (X = 1) = π
p(x) = πx(1− π)1−x, x ∈ {0, 1}
I Normal distribution
Perception: objects in the environment Robert Bosch Kft.
General Linear Models
General equation
E(Y ) = g−1(βTX),
where
I X: explanatory variables;
I Y : response variable from an exponentatial familydistribution;
I β: parameter vector;
I g: link function
Perception: objects in the environment Robert Bosch Kft.
General Linear Models
An example for GLM: linear regression
Model:E(Y ) = β0 + β1x1 + · · ·+ βkxk
Y is normally distributedLink function: g−1(E(Y )) = E(Y ) [identity]
Perception: objects in the environment Robert Bosch Kft.
Logistic regression
I Response variable Y is Bernoulli distributed withparameter π, i.e. the observations can correspond to twoclasses (binary case)→ if Y ∼ Bernoulli(π), then E(Y ) = π.
I X = {X1, X2, . . . , Xk} is the feature vector.I Odds ratio: ratio of π and 1− π, which gives a measure
for comparing class membershipsI Link function: logarithm of odds ratio
g(π) = log
(π
1− π
)I Model:
log
(π
1− π
)= β0 + β1X1 + · · ·+ βkXk
Perception: objects in the environment Robert Bosch Kft.
Logistic regression
Probably more familiar with mean function g−1(βTX):
π =1
1 + exp(−βTX)
Source: https://rcompanion.org/rcompanion/e06.html
Perception: objects in the environment Robert Bosch Kft.
Logistic regression
I We use a training set{X(i), Y (i)
}Ni=1
.
I Goodness of parameter vector = how correctly it works onthe training set ⇐⇒ gap/error is small
I Cost function/Error function/Loss function:measures the error of the estimate, the goal is to minimize
I Classical choice: mean squared error
MSE(β) =1
N
N∑i=1
(Yi − Yi)2
Perception: objects in the environment Robert Bosch Kft.
Logistic regression
I A more convenient cost function now:
CE(β) =− 1
N
N∑i=1
Y (i) log(g−1
(βTX(i)
))− 1
N
N∑i=1
(1− Y (i)) log(
1− g−1(βTX(i)
))Finding optimal parameter vector = minimizing cost function
Perception: objects in the environment Robert Bosch Kft.
Some notes on optimization
Gradient descent
Source: http://charlesfranzen.com/posts/multiple-regression-in-python-gradient-descent/
Perception: objects in the environment Robert Bosch Kft.
Some notes on optimization
Stochastic gradient descent
Source: Andrew Ng, Machine Learning (online course, Coursera)
Perception: objects in the environment Robert Bosch Kft.
Multiclass problem
Possible modifications:
I 1 vs. rest [K classifiers]
I 1 vs. 1 [K(K − 1)/2 classifiers]
I multinominal extension: for logistic regression, introducesoftmax function
πj =exp
(βTj X
)∑K
i=1 exp(βTi X
) ; j = 1, 2, . . . ,K
Perception: objects in the environment Robert Bosch Kft.
Evaluation
Confusion matrix
Source:https://www.packtpub.com/books/content/supervised-learning-classification-and-regressionLiu et. al, Learning accurate and interpretable models based on regularized random forestsregression, doi:10.1186/1752-0509-8-S3-S5
Perception: objects in the environment Robert Bosch Kft.
Evaluation
ROC curve
Source:http://jxieeducation.com/2016-09-27/Attractive-Mathematical-Properties-Of-The-ROC-Curve/
Perception: objects in the environment Robert Bosch Kft.
Naive Bayes classifier
Probabilistic model: the goal is to calculate the probability
p(Cj |x),
where Cj is the correspodence to class j, x = (x1, x2, . . . , xk) isan instance of the feature vector.Approach: Bayes theorem!
p(Ck|x) =p(x|Ck)p(Ck)
p(x)
Condition of ’naivety’: features are conditionallyindependent
p(xi|xi+1, . . . , xk, Cj) = p(xi|Cj)
Perception: objects in the environment Robert Bosch Kft.
Naive Bayes classifier
Using definition of conditional PDFs, law of total probabilityand chain rule, we can derive
p(Cj |x) =p(Cj)
∏ki=1 p(xi|Cj)∑k
i=1 p(Ci)p(x|Cj)
How to classify:
y = argmaxj∈{1,2,...,K}p(Cj)
k∏i=1
p(xi|Cj)
Perception: objects in the environment Robert Bosch Kft.
Naive Bayes-Gauss classifier
Perception: objects in the environment Robert Bosch Kft.
More general topics (not covered now)
I Bias, variance
I Problem of underfitting/overfitting
I Regularization
I Curse of dimensionality
I Feature engineering
I Model selection (e.g. elimination techniques)
Perception: objects in the environment Robert Bosch Kft.
More basic classification algorithms
I Decision Tree, Random Forest
I K-nearest neighbors
I Support Vector Machine
Perception: objects in the environment Robert Bosch Kft.
Deep Learning
Artificial Neural Networks
Source: https://www.digitaltrends.com/cool-tech/what-is-an-artificial-neural-network/
Perception: objects in the environment Robert Bosch Kft.
Deep Learning
Artificial Neural Networks
Source: https://www.mathworks.com/discovery/convolutional-neural-network.html
Perception: objects in the environment Robert Bosch Kft.
Deep Learning
Artificial Neural Networks
Source: http://www.flytxt.com/deep-learning-with-recurrent-neural-networks-rnn/
Perception: objects in the environment Robert Bosch Kft.
References
Online courses
I Kirill Eremenko, Machine Learning (udemy.com)
I Kirill Eremenko, Deep Learning (udemy.com)
I Andrew Ng, Machine Learning (coursera.org)
I Pennsylvania State University, Statistics online(https://onlinecourses.science.psu.edu/statprogram/)
Books
I Christopher Bishop, Pattern Recognition and MachineLearning, Springer, 2011
I Goodfellow et. al, Deep Learning, MIT Press, 2016
Useful links
I https://www.kaggle.com
I https://www.analyticsvidhya.com/
Perception: objects in the environment Robert Bosch Kft.
Thank You For YourAttention!
Perception: objects in the environment Robert Bosch Kft.