Docsity

ECE 417 Multimedia Signal Processing Final Exam - Spring 2021, Exams of Optics

Toggle sidebar
bg1
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Department of Electrical and Computer Engineering
ECE 417 Multimedia Signal Processing
Spring 2021
FINAL EXAM
Monday, December 13, 2021, 8:00-11:00am
•This is a CLOSED BOOK exam.
•You are permitted two sheets of handwritten notes, 8.5x11.
•Calculators and computers are not permitted.
•If you’re taking the exam online, you will need to have your webcam turned on. Your exam will
be provided by e-mail and on zoom at exactly 8:00am; you will need to photograph and upload
your answers by exactly 11:00am.
•There will be a total of 200 points in the exam. Each problem specifies its point total. Plan your
work accordingly.
•You must SHOW YOUR WORK to get full credit.
Name:
netid:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download ECE 417 Multimedia Signal Processing Final Exam - Spring 2021 and more Exams Optics in PDF only on Docsity!

UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN

Department of Electrical and Computer Engineering

ECE 417 Multimedia Signal Processing

Spring 2021

FINAL EXAM

Monday, December 13, 2021, 8:00-11:00am

• This is a CLOSED BOOK exam.

  • You are permitted two sheets of handwritten notes, 8.5x11.
  • Calculators and computers are not permitted.
  • If you’re taking the exam online, you will need to have your webcam turned on. Your exam will be provided by e-mail and on zoom at exactly 8:00am; you will need to photograph and upload your answers by exactly 11:00am.
  • There will be a total of 200 points in the exam. Each problem specifies its point total. Plan your work accordingly.

• You must SHOW YOUR WORK to get full credit.

Name:

netid:

Signal Processing and Linear Prediction

s[n] = Gx[n] +

∑^ N

m=

ams[n − m] = h[n] ∗ x[n]

H(z) =

G

∑N

m=1 amz −m

G

∏N

k=1 (1^ −^ pkz

∑^ N

k=

Ck 1 − pkz−^1

E =

∑^ ∞

n=−∞

e^2 [n] =

∑^ ∞

n=−∞

s[n] −

∑^ p

m=

ams[n − m]

∑^ ∞

n=−∞

s[n] −

∑^ p

m=

ams[n − m]

s[n − k], 1 ≤ k ≤ p

~γ = R~a

Image Interpolation

y[n 1 , n 2 ] =

x

[ (^) n 1 U ,^

n 2 U

] (^) n 1 U ,^

n 2 U both integers 0 otherwise

z[n 1 , n 2 ] = h[n 1 ] ∗ 1 (h[n 2 ] ∗ 2 y[n 1 , n 2 ])

hrect[n] =

1 0 ≤ n < U 0 otherwise

, htri[n] =

1 − | Un| −U ≤ n ≤ U 0 otherwise

, hsinc[n] = sin(πn/U ) πn/U

Optical Flow

∂f ∂t

= (∇f )T^ ~v

~v = (AT^ A)−^1 AT~b

Gaussians, GMMS, and Principal Components

p (^) X~ (~x) =

K∑− 1

k=

ck

(2π)D/^2 |Σ|^1 /^2

e−^

(^12) (~x−~μk )T (^) Σ− k 1 (~x−~μk )

(n − 1)Σ = V ΛV T^ ,

n − 1

Λ = V T^ ΣV, V T^ V = V V T^ = I

∑^ D

d=

σ d^2 =

n − 1

trace

XT^ X

n − 1

trace

Y T^ Y

n − 1

∑^ D

d=

λd

LSTM

f^ ~ [t] = σ(uf ~x[t] + wf~h[t − 1] + bf ), ~i[t] = σ(ui~x[t] + wi~h[t − 1] + bi), ~o[t] = σ(uo~x[t] + wo~h[t − 1] + bo)

~c[t] = f~ [t]~c[t − 1] +~i[t]g

uc~x[t] + wc~h[t − 1] + bc

, ~h[t] = ~o[t]~c[t]

  1. (17 points) A particular signal, x[n], has an autocorrelation function whose first two samples are:

R 0 = E

[

x^2 [n]

]

R 1 = E [x[n]x[n − 1]]

Suppose we want to model the signal spectrum as

|X(ω)| ≈

G

| 1 − ae−jω^ |

where G, R 0 , and R 1 are arbitrary constants. Write a as a function of G, R 0 , and/or R 1.

Solution: We can find the LPC coefficients using

~γ = R~a

where

R =

Rxx[0] · · · Rxx[p − 1] .. .

Rxx[p − 1] · · · Rxx[0]

 ,^ ~γ^ =

Rxx[1] .. . Rxx[p]

In this case, p = 1, so we have Rxx[1] = Rxx[0]a Therefore a = Rxx[1]/Rxx[0] = R 1 /R 0.

  1. (17 points) In a particular 2 × 2 block of pixels, the image gradient ∇x[n 1 , n 2 ] and the temporal rate of change ∂x∂t are given by the following table, where a,... , l are arbitrary constants: (n 1 , n 2 ) ∂x[n ∂n^1 ,n 12 ,t]^ ∂x[n ∂n^1 ,n 22 ,t]^ ∂x[n ∂t^1 ,n^2 ,t] (0,0) a e i (0,1) b f j (1,0) c g k (1,1) d h l Suppose that we want to model the video using optical flow, i.e.,

x[n 1 + v 1 , n 2 + v 2 , t] ≈ x[n 1 , n 2 , t] (1)

Find v 1 and v 2 so that the approximation in Eq. (1) is satisfied, for all four pixels of the im- age, with minimum mean-squared error. Your answer can include unresolved matrix multiplica- tions, matrix inversions, determinants and so on, but it should not include any variables other than a, b, c, d, e, f, g, h, i, j, k, l.

Solution: The optical flow equation is

∂x ∂t

∂x ∂n 1

v 1 +

∂x ∂n 2

v 2 (2)

Approximately satisfying Eq. (1) for all four pixels in the image simultaneously would give    

a e b f c g d h

[

v 1 v 2

]

i j k l

The error in Eq. (1) is minimized by the pseudo-inverse, i.e.,

[

v 1 v 2

]

a e b f c g d h

T 

a e b f c g d h

a e b f c g d h

T 

i j k l

  1. (17 points) Suppose you are studying the running behaviors of trained vs. untrained athletes. You have a sequence of feature vectors ~xt, where t is time (measured in centiseconds) and ~xt is a vector of features computed from a motion sensor being worn at the ankle. You have trained a neural network to compute bj (~xt) = p(~xt|qt = j), where qt ∈ {1 = heel strike, 2 = roll, 3 = lift, 4 = swing} denotes the gait phase. You also know the following probabilities:

ai,j = p(qt = j|qt− 1 = i) αt(i) = p(~x 1 ,... , ~xt, qt = i) βt(i) = p(~xt+1,... , ~xT |qt = i)

Your goal is to identify all of the instants when the heel first touches the ground, i.e., at each time step τ (1 ≤ τ ≤ T ), you want to find

PHS (τ ) = p(qτ − 1 = 4, qτ = 1|~x 1 ,... , ~xT )

Write a formula for PHS (τ ) in terms of αt(i), βt(i), ai,j , and bi(~xt), for any values of i, j, t that you find useful.

Solution: PHS (τ ) =

ατ − 1 (4)a 4 , 1 b 1 (~xτ )βτ (1) ∑ 4 i=

j=1 ατ^ −^1 (i)ai,j^ bj^ (~xτ^ )βτ^ (j)

  1. (17 points) In a neural network with residual connections (ResNet), the kth^ activation at layer `,

h( k), is equal to the activation of the same node at the previous layer, plus a computed residual g(ξ k( )):

ξ( k` )=

∑^ N

j=

w( k,j) h( j −1), 1 ≤ k ≤ N,

h( k)= h( k −1)+ g

ξ( k`)

, 1 ≤ k ≤ N,

where g(·) is a scalar nonlinearity, and w( k,j) is a network weight. Suppose that the training loss is L, and suppose you already know dL dh( k)

. Find dL dh( j−1) in terms of dL dh( k) , ˙g(ξ) = ∂g ∂ξ( k) , and w( k,j).

Solution: The total derivative rule gives us

dL dh( j`−1)

∑^ N

k=

dL dh( k`)

∂h () k ∂h( j)

dL dh (`) j

∑^ N

k=

dL dh (`) k

g ˙(ξ k())w( k,j)

  1. (17 points) A particular CNN has a grayscale image input, x[n 1 , n 2 ], and a one-channel output:

ξ[n 1 , n 2 ] = w[n 1 , n 2 ] ∗ x[n 1 , n 2 ],

where ∗ denotes convolution. The output is then max-pooled over the entire image:

ˆy = max 0 ≤n 1 <N 1 max 0 ≤n 2 <N 2 ξ[n 1 , n 2 ]

Suppose the weights and the input image are given by

w[n 1 , n 2 ] =

e−(n

(^21) +n (^22) ) − 3 ≤ n 1 ≤ 3 , − 3 ≤ n 2 ≤ 3 0 otherwise

x[n 1 , n 2 ] =

e−((n^1 −15)

(^2) +(n 2 −12) (^2) ) 0 ≤ n 1 ≤ 63 , 0 ≤ n 2 ≤ 63 0 otherwise

What is (^) dwd[2yˆ,1]? Your answer should be an explicit function of numerical constants; there should not be any variables in your answer.

Solution: dˆy dw[2, 1]

= e−^5

  1. (17 points) Sometimes, it’s not obvious, in advance, what loss function should be used to train a neural network. For example, suppose that we have a training database containing vector triples of the form (~x, ~y, ~z). Suppose we know that the set of vectors, ~x, can be divided in half through the origin such that for half of the vectors, ~y is a linear transformation of ~x, while for the other half, ~z is a linear transformation of ~x. In other words, for some matrices Uideal and Videal that we don’t know, and for some vector w~ideal that we don’t know: - If w~T ideal~x ≥ 0 then ~y = Uideal~x. - If w~T ideal~x < 0 then ~z = Videal~x.

Devise a differentiable non-negative loss function, L, that will approach zero as the estimated values of w, U~ , and V approach their true values. Write your loss as a function of the estimated parameters w, U ~ , and V , and as a function of the vectors in just one data triple, (~x, ~y, ~z).

Solution: First, we want differentiable functions of U and V that will be minimized when ~y = U~x and ~z = V ~x. Most of the functions that do this are norms of the vectors (~y − U~x) and (~z − V ~x), for example, the squared L2 norms, ‖~y − U~x‖^2 and ‖~z − V ~x‖^2 , are good choices. Second, we want to multiply ‖~y − U~x‖^2 by some modifier that goes to zero when w~T^ ~x < 0. The unit step function would do the trick, but it’s not differentiable; we need something that can be differentiated. The ReLU nonlinearity will do the trick:

L = ReLU( w~T^ ~x)‖~y − U~x‖^2 + ReLU(− w~T^ ~x)‖~z − V ~x‖^2

The sigmoid is also a good choice. It doesn’t go to zero immediately when w~T^ ~x < 0, but it goes to zero when w~T^ ~x  0. Since the problem specification doesn’t actually dictate the norm of w~ (it can be any scalar times w~ideal, and still meet the problem specifications), the sigmoid will also work here: L = σ( w~T^ ~x)‖~y − U~x‖^2 + σ(− w~T^ ~x)‖~z − V ~x‖^2

  1. (17 points) Suppose we have five variables, u, v, w, x, y. All but seven of their partial derivatives are zero; for example, (^) ∂u∂y (u, v, w, x, y) = ∂y∂x (u, v, w, x, y) = 0. The only seven nonzero partial derivatives are ∂u ∂x

(u, v, w, x, y) = a,

∂v ∂x

(u, v, w, x, y) = b ∂w ∂u (u, v, w, x, y) = c,

∂w ∂v (u, v, w, x, y) = d ∂w ∂x

(u, v, w, x, y) = e,

∂y ∂v

(u, v, w, x, y) = f ∂y ∂w (u, v, w, x, y) = g,

In terms of the constants a, b, c, d, e, f , and g, find ∇  x u

 

y, the gradient of y with respect to the

vector [x, u]T^.

Solution: The gradient is defined to be

 x u

 

y =

[ (^) ∂y ∂x ∂y (u, x) ∂u (u, x)

]

i.e., the vector of partial derivatives while keeping constant only the other elements of the same vector. Drawing a flow graph, we find

x

u

v

w

y

In this case we can write the total derivative rule as ∂y ∂x

(u, x) =

dy dv

∂v ∂x

(u, v, w, x, y) +

dy dw

∂w ∂x

(u, v, w, x, y)

∂y ∂v

dy dw

∂w ∂v

∂v ∂x

(u, v, w, x, y) + dy dw

∂w ∂x

(u, v, w, x, y)

= (f + gd)b + ge

Similarly,

∂y ∂u

(u, x) =

dy dw

∂w ∂u

(u, v, w, x, y)

= gc

So ∇  x u

 

y =

[

f b + gdb + ge gc

]

  1. (30 points) Consider a bidirectional two-layer recurrent network that has been trained to perform the following computations.
    • The first layer has forward and backward cells which perform the following computations given an input x ∈ < and prior hidden states f ∈ <, b ∈ <:

forward : ft = sin(xtwx + ft− 1 wh + b)^2 , backward : bt = sin(xtwx + bt+1wh + b)^2 ,

where the weights are wx = π 4 , wh = π 2 , and b = π 2.

  • The second layer has forward and backward cells which perform the following computations given an input ~ξ ∈ <^2 and a prior hidden states y ∈ <, z ∈ <:

forward : yt = cos

( (^) π 2

( w~xT ~ξt + whyt− 1 + b)

backward : zt = cos

( (^) π 2

( w~xT ~ξt + whzt+1 + b)

where the weights are wx = [2, 1]T^ , wh = 2, and b = 1. Assume that the prior hidden state, before each cell reads its first input, is 0. (a) Consider the input sequence [x 1 , x 2 , x 3 ] = [4, 1 , 7]. What are the forward outputs [f 1 , f 2 , f 3 ] and the backward outputs [b 3 , b 2 , b 1 ] from the first layer?

Solution:

[f 1 , f 2 , f 3 ] = [1,

, 1]

[b 3 , b 2 , b 1 ] = [

, 0 , 1]