Exam - 2017 Flashcards
Write in pseudocode a controller for a robot that wanders on the floor and
avoids obstacles. The robot is equipped with wheels and whiskers sensors.
[5p]
start motors loop: while no contact drive forward if contact then drive backwards a while and turn end_loop
What is the difference between image spatial resolution and image colour
resolution ? Give an example for both. [3p]
Spatial resolution is defined as the number of pixels in x and y
direction. Example 400x600. On the other hand, colour resolution is
defined as the number of bits needed to store each pixel’s colour.
Example 24 bits for RGB, 1 bit for B&W.
A signal is sampled with Fs=1000 Hz and one performs FFT for N=1000
samples, how many FFT coefficients one needs to plot in order to clearly
visualize the range [0-100 Hz] in the frequency spectrum? [2p]
the distance between two stems is Fs/N = 1Hz. Therefore we need for example 120 stems, or FFT coefficients to visualize properly the 50 Hz peak.
Explain the principle of classification using template matching. [4p]
Template matching is a classification technique. each class is represented
by a single pattern. A set of such reference patterns (or prototypes) is
available and stored in a database. Given an new, unknown test pattern,
template matching consists of searching the database for the reference
pattern most “similar” to the given test pattern. We have for example two
letters A and B and for each class we have one template. To classify a
newcomer we have to simply compare it to the two templates.
The question is now how to measure this resemblance. This can be done in a
couple of equivalent ways:
- Count the number of agreements (black matching black and white
matching white) and pick the class that has the highest number of
agreements. This is the so-called maximum correlation approach. - Count the number of disagreements (black where there should be white
or white where it should be black). Pick the class with the lowest number
of disagreements. This is the minimum error approach.
The advantage is that this method is very simple to implement.
The disadvantage is that it does not work if the newcomer image has another size
or orientation.
Explain how does
the network learn to classify
Because the outputs are 0 or 1, it means that a NN can be used for
classification. The inputs are the features and the output shows the class.
There are 7 input neurons, one for each moment of Hu. There are 4 output
neurons for four classes.
The weights in NN are adjustable and this is good because it means a NN can learn to classify.
Learning is done by training the NN in order to adjust the weighting coefficients of each
neuron.
The training set consists of sequences of features (inputs) and
the class (output). For three letters recognition, the features can be the
pixel vector or some other shape features. 3 outputs O1, O2, O3 can be
used with the convention:
O1=1 O2 = 0 O3 =0 O4=0 class A,
O1 =0 O2 = 1 O3 =0 O4= 0 class B
O1 = 0 O2 = 0 O3 =1 O4 = 0 class C
O1=0 O2 = 0 O3= 0 O4 = 1 class D
Once the NN is trained, classification can begin. A newcomer is given as input to the NN and it will issue the class this newcomer belongs to.
What is a Hidden Markov Model? How can we use it to recognize activity
in a kitchen ? [6p]
HMM are Hidden Markov models. These are graphical probabilistic
reasoning algorithms that can be used for example for classification. They
are dynamic models because the states are evolving in time. They contain
hidden states and observable states connected with edges. Each
transition from on estate into another has a certain probability. The
challenge is to infer the hidden states knowing the visible observable
states. For example we mount sensors in a house (door, bed, floor, toilet)
in order to monitor its inhabitants daily activity(cooking, sleeping,
washing, toileting, etc). A HMM will connect the visible states z given by
the sensor readings and the hidden states x (cooking, sleeping, washing,
toileting, etc). The transition probabilities p(zt|zt-1), p(zt|xt) are
established by long days of training, annotation, etc. The hidden states
given by the probability that you are in state x knowing the observable z,
p(x|z) are inferred by using Bayes theory.
What is a confusion matrix ? Define its components. Show an example of
a “good” confusion matrix for a pedestrian detection system in an
intelligent car. Justify your answer. [4p]
A confusion matrix summarizes the results of a classification test. It gives information on how frequently instances of class A were correctly classified as class A or misclassified as another class. The entries in a confusion matrix are counts, i.e. integers, showing the true positives, the true negatives, the false positive sand the false negatives.
For a system
that recognizes pedestrians, an ideal matrix should have zero false
negatives and a low false positives (false alarms).
Imagine that you have to design an automatic insulin pump that keeps
simulates a human pancreas. The goal is to keep the blood glucose
concentration (BGC) of diabetic patients (whose pancreas does not function
properly) in the range [4,0-5,5] mmol/L. The pump monitors the BGC , and
when the BCG raises above 5.5 mmol/L, it calculates the needed insulin dose
and injects it. The system keeps track of all the injected insulin doses. An
overdose of insulin is, in the short term, fatal. Too much blood sugar is, in the
long term, dangerous for the eyes, kidneys and heart.
Identify two hazards, and for each hazard estimate its risk and
imagine a design solution to mitigate it. [5p]
Over doses because of hacking. Risk is unacceptable.
Mitigation measure: use encrypted communication between the pump and
the server. Under-dose because of air in the tubing. Risk: high. Solution.
Measure the effect of pumping. if BGC does not drop, then issue an
alarm.
Imagine that you have to design an automatic insulin pump that keeps
simulates a human pancreas. The goal is to keep the blood glucose
concentration (BGC) of diabetic patients (whose pancreas does not function
properly) in the range [4,0-5,5] mmol/L. The pump monitors the BGC , and
when the BCG raises above 5.5 mmol/L, it calculates the needed insulin dose
and injects it. The system keeps track of all the injected insulin doses. An
overdose of insulin is, in the short term, fatal. Too much blood sugar is, in the
long term, dangerous for the eyes, kidneys and heart.
Write a set of test cases using Boundary Value Analysis to test the
functionality of the pump. [5p]
BVA uses values from the boundaries of the range and in the middle. So the following test cases are generated: ID input [mmol/L] expected output TC1 3.9 alarm low sugar TC2 4 nothing-normal TC3 4,1 nothing- normal TC4 5 nothing- normal TC5 5,4 nothing-normal TC6 5,5 nothing normal TC7 5,6 alarm high sugar start-injecting
What is the difference between an Agile and a waterfall development
process? [3p]
Agile development uses short sprints of 2-3 weeks (requirements, design,
coding, testing) and intense contact with the user. There is always a
working version of the product. Changes are easy to implement. Waterfall
is working with the same phases but without iterations. Requirements
are frozen, changes are not welcome, testing only at the end. User I
hardly ever involved.