Deep Learning Week 1 Assignment Answers
Course Link: https://onlinecourses.nptel.ac.in/noc23_cs56/course
Q1) From a pack of 52 cards, two cards are drawn together at random. What is the probability of both the cards being kings?
a. 1/15
b. 25/57
c. 35/256
d. 1/221
Explanation
There are four kings in a deck of 52 cards. The probability of drawing one king at random is 4/52. Since the two cards are drawn together, the probability of both cards being kings is (4/52) * (3/51) = 1/221.
Q2) For a two class problem Bayes minimum error classifier follows which of following rule? (The two different classes are w₁ and w2, and input feature vector is x)
a. Choose w₁ if P(w₁/x) > P(w2/x)
b. Choose w₁ if P(w₁)>P(w2)
c. Choose w2 if P(w₁)2)
d. Choose w2 if P(w₁/x) > P(w2/x)
Explanation
Bayes minimum error classifier is a type of Bayes classifier that minimizes the probability of misclassification. It chooses the class with the highest posterior probability, given the input feature vector x. So, it follows the rule of choosing class w₁ if P(w₁/x) > P(w2/x) where P(wi/x) = P(x/wi) * P(wi) / P(x) , P(wi) is prior probability of class wi and P(x/wi) is likelihood of x given class wi.
Q3) The texture of the region provides measure of which of the following properties?
a. Smoothness alone
b. Coarseness alone
c. Regularity alone
d. Smoothness, coarseness and regularity
Explanation
Texture can be characterized in terms of various properties such as smoothness, coarseness and regularity. Smoothness refers to the degree to which the elements within the region are evenly distributed and lack variation. Coarseness refers to the degree to which the elements within the region are unevenly distributed and have a lot of variation. Regularity refers to how elements are arranged in a pattern.
Q4) Why convolution neural network is taking off quickly in recent times? (Check the options that are true.)
a. Access to large amount of digitized data
b. Integration of feature extraction within the training process.
c. Availability of more computational power
d. All of the above.
Explanation
Convolutional Neural Networks (CNNs) are a type of deep learning architecture that have become increasingly popular in recent times for a number of reasons:
a. Access to large amount of digitized data: With the increasing amount of digital data available, such as images, videos, and audio, CNNs have become a powerful tool for processing and analyzing this data.
b. Integration of feature extraction within the training process: CNNs incorporate the process of feature extraction, which is the process of identifying important features in the data that can be used to classify or identify patterns in the data. This is done through the use of convolutional layers, which scan the input image, and learn to identify relevant features.
c. Availability of more computational power: CNNs are computationally intensive, and require large amounts of data to train. The increased availability of computational resources, such as GPUs, has made it possible to train large, deep CNNs on large datasets, which has further increased their accuracy and performance.
Therefore, all of the options a, b, and c are true and contribute to the CNN’s quick take off in recent times.
Q5) The bayes formula states :
a. posterior = likelihood*prior/evidence
b. posterior = likelihood*evidence/prior
c. posterior = likelihood * prior
d. posterior = likelihood * evidence
Explanation
The Bayes formula, also known as Bayes’ theorem, states that the posterior probability of a hypothesis given some evidence is proportional to the product of the likelihood of the evidence given the hypothesis, and the prior probability of the hypothesis. Mathematically, it can be represented as:
P(H|E) = P(E|H) * P(H) / P(E)
Where:
P(H|E) is the posterior probability of the hypothesis H given the evidence E.
P(E|H) is the likelihood of the evidence E given the hypothesis H.
P(H) is the prior probability of the hypothesis H.
P(E) is the evidence, also called the marginal likelihood or the normalizing constant.
Therefore, the correct option is a. posterior = likelihood*prior/evidence
Q6) Suppose Fourier descriptor of a shape has K coefficient, and we remove last few coefficient and use only first m (m
a. We will get a smoothed boundary version of the shape.
b. We will get only the fine details of the boundary of the shape.
c. Full shape will be reconstructed without any loss of information.
d. Low frequency component of the boundary will be removed from contour of the shape.
Explanation
The Fourier descriptor is a mathematical representation of a shape using the Fourier transform, which decomposes the shape’s boundary into a set of complex coefficients. The coefficients represent the amplitude and phase of different frequency components of the shape’s boundary. By using only the first m coefficients, we are effectively removing the higher frequency components of the shape’s boundary, which corresponds to the fine details of the shape.
Therefore, if we use only the first m coefficient, we will get a smoothed version of the shape, which would have less fine details of the boundary of the shape. So the correct option is a. We will get a smoothed boundary version of the shape.
Q7) The plot of distance of the different boundary point from the centroid of the shape taken at various direction is known as
a. Signature descriptor
b. Polygonal descriptor
c. Fourier descriptor.
d. Convex Hull
Explanation
A signature descriptor is a mathematical representation of a shape that describes the distance of different boundary points from the centroid of the shape at various orientations. It is also called Radial Distance Function (RDF) . It is plotted as a graph of the distance of each boundary point from the centroid of the shape at different angles. This plot gives an overall view of the shape, which can be used to compare and match shapes.
A polygonal descriptor is a mathematical representation of a shape that describes the shape as a sequence of connected line segments.
Fourier descriptor is a mathematical representation of a shape using the Fourier transform, which decomposes the shape’s boundary into a set of complex coefficients.
Convex Hull is the smallest convex shape that contains all the points of the shape.
Therefore, the correct option is a. Signature descriptor
Q8) If the larger values of gray co-occurrence matrix are concentrated around the main diagonal, then which one of the following will be true?
a. The value of element difference moment will be high.
b. The value of inverse element difference moment will be high.
c. The value of entropy will be very low.
d. None of the above.
Explanation
A gray co-occurrence matrix (GLCM) is a matrix that describes the texture of an image. It is calculated by counting the number of times different gray-level values appear in pairs at a specific distance and direction from each other in an image. The values of the GLCM are arranged in a matrix, with one dimension representing the gray-level of one pixel, and the other dimension representing the gray-level of a neighboring pixel.
If the larger values of GLCM are concentrated around the main diagonal, it means that the pixels in the image have similar gray-levels, and there is a high degree of correlation between the gray-levels of neighboring pixels. This results in a low entropy, which is a measure of randomness or disorder in the image.
Entropy is calculated using GLCM and it is a measure of the randomness or disorder in the image. Higher the entropy, more randomness in the image and lower the entropy more ordered the image is.
Therefore, the correct option is c. The value of entropy will be very low.
Q9) Which of the following is a Co-occurrence matrix-based descriptor.
a. Entropy
b. Uniformity
c. Signature
d. Inverse Element difference moment.
e. All of the above.
Explanation
A co-occurrence matrix (GLCM) is a matrix that describes the texture of an image. It is calculated by counting the number of times different gray-level values appear in pairs at a specific distance and direction from each other in an image. The values of the GLCM are arranged in a matrix, with one dimension representing the gray-level of one pixel, and the other dimension representing the gray-level of a neighboring pixel.
From the given options:
Uniformity is a descriptor that can be calculated from the GLCM by summing the squares of all the elements in the matrix and dividing by the number of elements in the matrix.
Entropy, measures the randomness or disorder in the image and is calculated using GLCM.
Signature descriptor is a mathematical representation of a shape that describes the distance of different boundary points from the centroid of the shape at various orientations.
Inverse element difference moment is calculated using GLCM, It is a statistic that reflects the homogeneity of the gray level distribution in the image.
Therefore, the correct option is b. Uniformity.
Q10) Consider two class Bayes’ Minimum Risk Classifier. Probability of classes W1 and W2 are, P (w₁) =0.3 and P (w₂) =0.7 respectively. P(x) = 0.55, P (x| w₁) = 0.75, P (x| w2) =0.45 and the loss matrix values are
Find the Risk R (α₂|x).
a. 0.42
b. 0.61
c. 0.48
d. 0.39
Explanation
The Risk R(α₂|x) is the sum of the product of the loss and the conditional probability of the decision error given the evidence.
R(α₂|x) = L(α₂, w₁) * P(w₁|x) + L(α₂, w₂) * P(w₂|x)
We know the following values:
P (w₁) =0.3 and P (w₂) =0.7
P(x) = 0.55
P (x| w₁) = 0.75, P (x| w₂) =0.45
Loss matrix values are L(w₁,w₂) = 10, L(w₂,w₁) = 5
Using Bayes rule:
P(w₁|x) = P(x|w₁) * P(w₁)/P(x)
P(w₂|x) = P(x|w₂) * P(w₂)/P(x)
Substituting in the above equation we get:
R(α₂|x) = 10* (0.750.3)/0.55 + 5(0.45*0.7)/0.55
R(α₂|x) = 0.61
Therefore, the correct option is b. 0.61