0% found this document useful (0 votes)
148 views6 pages

CS3002 Solution Paper 2015.16 - v2

This exam paper contains questions on various topics in artificial intelligence including chatbots, clustering algorithms, neural networks, Bayesian networks, hidden Markov models, and expert systems. It provides example problems and asks students to calculate metrics, describe algorithms, and discuss concepts. The paper is for a full 3 hour exam on the module Artificial Intelligence for the Computer Science department.

Uploaded by

Manl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views6 pages

CS3002 Solution Paper 2015.16 - v2

This exam paper contains questions on various topics in artificial intelligence including chatbots, clustering algorithms, neural networks, Bayesian networks, hidden Markov models, and expert systems. It provides example problems and asks students to calculate metrics, describe algorithms, and discuss concepts. The paper is for a full 3 hour exam on the module Artificial Intelligence for the Computer Science department.

Uploaded by

Manl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Exam Solutions

College / Institute College of Engineering, Design and Physical Sciences

Department Computer Science

Exam Author(s) Allan Tucker, Yongmin Li, Zidong Wang

Module Code CS3002

Module Title Artificial Intelligence

Month April / May Year 2015/16

Paper Type Full

Duration 3 hours

Question No. Marks

1. Briefly describe the Turing Test, what a chatbot is, and how the early chatbots (1970s) worked
with an example . [3 marks] 3

Fool a person / panel of judges by simulating a person communicating via text on screen.
E.g. Eliza simulating a psychiatrist
Pattern matching based on key words such as “mother” or “father” resulting in the reply “tell me
more about your family”

2 a) Briefly describe the K-Means clustering algorithm.


[2 marks]
6
Given K parameter = number of clusters, allocate K random centroids
Distance metric to assign data to nearest centroid
Move each centroid to the centre of their allocated data
Repeat until centroids do not move

b) Why might fuzzy clustering approaches be advantageous over standard K-Means?


[2 marks]

Fuzzy C Means – can deal with overlapping clusters by assigning weights-per-cluster to data
rather than a single cluster allocation. However, deciding how to allocate clusters based on this is
not always easy.

c) Calculate the Euclidean distance and Manhattan Distance between the following 3 data points
that represent the outcome of 5 clinical tests for 2 patients:
x1 = [1.6, 0.0, 0.5, 0.1, 0.4]
x2 = [2.6, 0.9, 0.8, 0.9, 0.4]
[2 marks]
Euclidean: x1_x2 sqrt(1.00 + 0.81 + 0.09 + 0.64 + 0.00) = 1.59
Manhattan: x1_x2 1 + 0.90 + 0.3 + 0.8 + 0 = 3

3 Classification
a) Briefly describe the K nearest neighbour classifier with an example diagram, demonstrating
how it classifies data. 9
[3 marks].

Distance metric
K neighbourhood
Voting / weighting function

b) Name one advantage and one disadvantage of the KNN classifier over other classifiers?
[3 marks]

No model so no assumptions of distributions / biases


Transparent approach to classification

Selecting K, distance metric and the weighting can be tricky.

c) Describe overfitting, cross-validation, and the relationship between the two [3 marks]

Model that fits too closely to data including irrelevant features or noise due to too many
parameters. Cross validation can deal with this by assessing test sets by partitioning the data into
different subsets, each of which are used as an independent test set.

4 Sensitivity
Given the following confusion matrix generated by a classifier over 100 test cases:
3

Predict Predict
True False
Observe
50 0
True
Observe
20 30
False

a) Calculate the Sensitivity, the specificity, and the accuracy


[3 marks]

Sensitivity = 50/50 = 1.0


Specificity = 30/50 = 0.6
Accuracy = (50+30)/100 = 80%

5 Neural Networks
Given the following Perceptron with two inputs and one output
9
where w1 = 0.3 , w2 = 0.3, and θ = 0.5. And the threshold function f returns 0 if the output is less
than or equal to 0, otherwise it returns 1. Calculate the output y for:

i) x1 = 0 and x2=0
ii) x1 = 0 and x2=1
iii) x1 = 1 and x2=0
iv) x1 = 1 and x2=1

[4 marks]

i) y = 0 + 0 -0.5 = -0.5: 0
ii) y = 0 + 0.3 – 0.5 = - 0.2: 0
iii) y = 0.3 + 0 – 0.5 = - 0.2: 0
iv) y = 0.3 + 0.3 – 0.5 = 0.1: 1

b) Briefly describe the key characteristics of backpropagation in multilayer neural networks?


[3 marks]

Forward pass to propagate inputs to outputs


Error derivation is then propagated back through the network
Weights are updated based on these errors
Learning parameter limits the extent of the changes to prevent large cyclic behaviours.

c) What is the advantage of having hidden layers in a multilayer neural network over a simple
perceptron?
[2 marks]

e.g. Enable the summarization / calculation of intermediate features that help in constructing
non-linear functions / decision boundaries.
10
6 Expert Systems

For forward chaining, the reasoning starts from the known data and proceeds forward with that
data. For backward chaining, an expert system has a goal and the inference engine attempts to
find the evidence to prove it.

a) We can use forward chaining to go from premises to goal. Briefly discuss the problem (i.e.,
disadvantage) with forward chaining. [4 marks]

In forward chaining, many rules may be executed that have nothing to do with the established
goal. Therefore, if our goal is to infer only one particular fact, the forward chaining inference
technique would not be efficient.

b) In problem solving, how do you choose between forward and backward chaining? [4 Marks]
ANSWER: If an expert first needs to gather some information and then tries to infer from it
whatever can be inferred, choose the forward chaining inference engine. However, if your expert
begins with a hypothetical solution and then attempts to find facts to prove it, choose the
backward chaining inference engine.

c) In both forward chaining and backward chaining, a method for choosing a rule to fire when
more than one rule can be fired in a given cycle is called conflict resolution. Could you please
propose one particular method for conflict resolution and explain how your method works? [3
Marks]

ANSWER: One of the following:

1) Fire the rule with the highest priority. In simple applications, the priority can be established by
placing the rules in an appropriate order in the knowledge base. Usually this strategy works well
for expert systems with around 100 rules.

2) Fire the most specific rule. It is based on the assumption that a specific rule processes more
information than a general one.

3) Fire the rule that uses the data most recently entered in the database. This method relies on
time tags attached to each fact in the database. In the conflict set, the expert system first fires
the rule whose antecedent uses the data most recently added to the database.

6
7 Bayesian Networks
Given the following Bayesian network:

a) Describe the Markov blanket and what is the Markov blanket of “TB or Cancer” in the BN
above? [2 marks]

Markov blanket is the set of parents of a node, the children of a node, and the parents of the
children of a node. It renders the node independent of all other nodes.
In the BN the following represent the Markov blanket of “TB or Cancer” = {Lung Cancer, TB, X-Ray
Positive, Dyspnoea, Bronchitis}

b) Calculate the following probabilities in the Bayesian Network below:


i) P(Prize = Door 1, First Selection = Door 1, Monty Opens Door 3)
ii) P(Prize = Door 2, First Selection = Door 1, Monty Opens Door 3)
[4 marks]

Prize Probability First Selection Probability


Door 1 0.333 Door 1 0.333
Door 2 0.333 Door 2 0.333
Door 3 0.333 Door 3 0.333

Monty Opens
Prize First Selection Door 1 Door 2 Door 3
Door 1 Door 1 0.0 0.5 0.5
Door 1 Door 2 0.0 0.0 1.0
Door 1 Door 3 0.0 1.0 0.0
Door 2 Door 1 0.0 0.0 1.0
Door 2 Door 2 0.5 0.0 0.5
Door 2 Door 3 1.0 0.0 0.0
Door 3 Door 1 0.0 1.0 0.0
Door 3 Door 2 1.0 0.0 0.0
Door 3 Door 3 0.5 0.5 0.0

i) 0.333 * 0.333 * 0.5 = 0.0554


ii) 0.333 * 0.333 * 1.0 = 0.111

8 Hidden Markov Models 4

Give the following Hidden Markov model:

Initial distribution: P(H1 = i ): 𝜋 = [0.9 0.1]

Transition distribution: P(Ht = j | Ht-1 = i):


t
0.6 0.4
A= 
t-1

 0.1 0.9

Emission Distribution:
X
1.0 0.0
B= 
H

0.4 0.6

What is the probability of observing the following hidden and observed states:
H=1111
O=1111
[4 Marks]

= 𝜋1B11 A11 B11 A11 B11 A11 B11


= 0.9 x 1.0 x 0.6 x 1.0 x 0.6 x 1.0 x 0.6 x 1.0 = 0.1944

10
9 Image Analysis
a) Describe the steps of edge detection in general. Name a few common edge detectors.
[6 marks]

1. Filtering – Filter image to improve performance of the Edge Detector wrt noise
2. Enhancement – Emphasize pixels having significant change in local intensity
3. Detection – Identify edges by, e.g. thresholding
4. Localization – Locate the edge accurately, estimate edge orientation

The commonly used edge detectors include Roberts, Sobel, Prewitt and Canny detectors etc.

b) Explain the process of detecting straight lines in an image using the Hough transform.
[4 marks]

Line detection is usually performed after edges are detected in an image. However, fitting lines
from edge pixels can be problematic due to various factors such as extraneous data, missing
data, noise and computational cost. The Hough transform is aimed to transform the original line
fitting problem into a simple voting problem in a parameter space. For example, if we use the
polar coordinate to represent a line, each edge pixel corresponds to a sinusoid in the parameter
space, and the set of pixels that form a straight line will produce sinusoids that cross at the
parameters of the line. Therefore the line detection problem is now converted to the problem of
finding the highest voted points in the parameter space.

END

You might also like