12. You are given an image database containing images of animals and human faces. You are required to extract discriminative features for each of the image in the database and design an inference system to automatically detect between animals and human faces. Describe all the steps with an example.
Added by Jill D.
Close
Step 1
- Ensure the dataset is balanced, meaning it has an equal number of images for each class (animals and human faces). - Preprocess the images by resizing them to a uniform size, converting them to grayscale, and normalizing the pixel values. Show more…
Show all steps
Your feedback will help us improve your experience
Madhur L and 88 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Text: Explain in brief all the below questions. 1. Affine image transform. Geometric image degradations. 2. Biomedical image classification: discriminant analysis. 3. Biomedical image classification: k-nearest-neighbor (k-NN) classifier, k-means clustering. 4. Biomedical image classification: hierarchical clustering, structural/syntactic classification.
Madhur L.
Question 1 [15 pt]: You want to teach a robot to recognize cat, using a set of features (the presence of blue eyes (b), stripe (s), or spot (m)). You also have several pictures of dogs to use as negative examples. The following table summarizes the content of training samples. Each binary feature is represented as 1 (meaning the feature is present) or 0 (meaning it is absent). The subject y of the photo is encoded as +1 for cat or -1 for dog. (m) (b) (s) Subject (y) 0 0 0 +1 1 0 0 +1 1 1 0 +1 0 1 1 +1 1 0 1 -1 1 1 1 -1 1. Suppose the robot has a Naive Bayes based brain. Write the Naive Bayes classification rule for this problem (i.e. write a formula which given a data point x = (m, b, s) returns the most likely subject y). Write the formula in terms of conditional and prior probabilities. Be explicit about which parameters are involved, but you do not need to estimate them yet. 2. Assuming no smoothing, give estimates for the parameters of the classification rule based on the training samples. 3. Suppose a subject which has stripe but no spot or blue eyes. What would happen if the robot had to guess the identity of the subject? 4. Suppose now that the robot performs Laplace smoothing with strength k = 1 (on both the prior and class-conditional parameters). Re-estimate the parameters. Now how will the robot classify this new subject with stripe and without spot or blue eyes?
Supreeta N.
k-means Clustering on Images In this problem, you'll do some basic exploration of the clustering techniques on the MNIST dataset. This dataset contains a set of handwritten digits (see Figure 1), within 10 different classes (0, 1, ..., 9). Each image has a size of 784 = 28 × 28 (width × height). For this problem, we will use a subset of n = 1000 images that includes 4 types of digits (0, 1, 2, 3). Figure 1: MNIST samples In the original dataset, each images is represented by a 784 × 1 vector. In order to make the task easier, we will project the images into a two-dimensional space with principle component analysis (PCA). We have implemented this in the notebook. Run the corresponding block in the notebook. You will find a two-dimensional scatterplot of the images, in which the coordinates of each point are the top two principle components of an images, and the color of each point represents its label in the dataset. We will work on this simpler two-dimensional dataset in our problem. Please follow the instruction in the notebook to complete the following tasks. (a) Implement the standard k-means algorithm. You are NOT allowed to directly copy any existing code of k-means for this problem. (b) Run your k-means function on the 2D dataset (of the top two PCA components). Set the number of clusters to be k = 4. Visualize the result by coloring the 2D points in (a) according to their clustering labels, returned by your k-means algorithm. Because k-means is sensitive to initialization, repeat your k-means code for at least 5 times with different random initializations and show the plot of each initialization. http://yann.lecun.com/exdb/mnist/ To quantitatively evaluate the clustering performance, we evaluate the unsupervised clustering accuracy, which can be written as follows, accuracy = max_M (Σ^n_{i=1} Ġ(y_i = M(z_i))) / n, n = 1000, where y_i is the ground-truth label, z_i is the cluster assignment produced by the algorithm, and M ranges over all possible one-to-one mapping between clusters and labels and Ġ(x) is a indicator function (Ġ(x) = 1 if x = 1; otherwise 0). Calculate the best clustering accuracy you get out of 10 random initializations. (c) We have been testing k-means on the top two principal components for visualization purpose. Please run k-means on the (784 dimensional) original image dataset (use again k = 4 clusters). Try at least 10 different random initializations and show the best accuracy as above.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD