Question

In: Computer Science

You have been given a task to differentiate between the images of a cat and a...

  1. You have been given a task to differentiate between the images of a cat and a dog. You have been given a dataset of 50000 coloured images of size 40x40 which contains either a cat or a dog. Being as specific as you can, please detail the procedure of how you are going to solve this problem.

Solutions

Expert Solution

There are many ways in Machine Learning (ML) and Deep Learning(DL).

In the given question the dataset is comprised of photos of dogs and cats provided as a subset of photos from a much larger dataset of 50000 coloured images of 40X40.

Please follow below algorithm:

1. Plot dog photos from the dogs vs cats dataset

2. Define location of dataset

3. Plot first few images

4. Define subplot and filename

5. Load image pixels

6. Plot given raw pixel data

7.Display the figure

8. Plot CAT photos from the dogs vs cats dataset (follow the same as 2 to 7 above step)

lets assume that images are standaized.

Now, If we want to load all of the images into memory, you can load and save them as single NumPy array.( this optional, however increases the performance of the model).

9. Now load and confirm images shape and size.

Strucutre the dataset directory and images properly.

Now, we can randomly decide to consider 25% of the images into the test dataset.

Developing CNN Model: " Baseline model"

A baseline model will establish a mini. model performance to all of our models.You can use VGG model. The model will be fit with stochastic gradient descent and better to start with a conservative learning rate of 0.001 and a momentum of 0.9. The given problem is a binary classification task, this requirs the prediction of one value of either 0 or 1. It is also required to use an output layer with 1 node and a sigmoid activation ( for better performnace use can use the binary cross-entropy loss function).

10. Prepre the data for model (i.e for traning and testing)

11. Use 15 or 20 epochs to fit the model

12. Plot loss and accuracy

( you can deifne and check different number of VGG models for Entropy loss and classification accuracy)

I hope you can write code either in python or R.


Related Solutions

You are an intern with an equity research organization. You have been given the task to...
You are an intern with an equity research organization. You have been given the task to project the values of certain income statement and balance sheet items for the next year (FY2020) for ABC Ltd (Your current time=0 is FY ending 2019). You have collected information about the historical income statement and balance sheet items. The historical information is provided in Table 1. Table 1 PARTICULARS (All values in INR crores) FY2019 FY2018 FY2017 FY2016 Sales Revenue 21118.00 22084.00 17273.00...
You have been given the task of calculating the WACC of ABC Inc. You will use...
You have been given the task of calculating the WACC of ABC Inc. You will use the following information to calculate the WACC. The firm has 3000 coupon paying bonds outstanding. Each coupon-paying bond has a face value of $1000, will mature 10 years from today, and is currently priced at 130% of the face value. The annual coupon rate is 12%, and coupon is paid on an annual basis. The company has 500,000 common shares outstanding, and each share...
You have been given the task of calculating the WACC of ABC Inc. You will use...
You have been given the task of calculating the WACC of ABC Inc. You will use the following information to calculate the WACC. The firm has 3000 coupon paying bonds outstanding. Each coupon-paying bond has a face value of $1000, will mature 10 years from today, and is currently priced at 130% of the face value. The annual coupon rate is 12%, and coupon is paid on an annual basis. The company has 500,000 common shares outstanding, and each share...
5. You have been given the task of determining if the number of board feet of...
5. You have been given the task of determining if the number of board feet of lumber (Volume) from a black cherry tree can be predicted from the diameter of the tree at 54 inches from the ground. You have data from 31 black cherry trees in New Zealand about their volume, height, and diameter. You need to analyze the data and write a couple of sentences discussing the questions below. Follow the steps we use in class to analyze...
You have been given the task to evaluate a market opportunity for a firm. Give specific...
You have been given the task to evaluate a market opportunity for a firm. Give specific examples of the dimensions you would use to determine the attractiveness of a given market. (Strategic Marketing)
Suppose you have been given the task of distilling a mixture of hexane + toluene. Pure...
Suppose you have been given the task of distilling a mixture of hexane + toluene. Pure hexane has a refractive index of 1.375 and pure toluene has a refactive index of 1.497. You collect a distillate sample which has a refractive index of 1.441. Assuming that the refractive index of the hexane + toluene mixture varies linearly with mole fraction, what is the mole fraction of hexane in your sample?
You have been given the task of organizing a poll regarding an upcoming election. The object...
You have been given the task of organizing a poll regarding an upcoming election. The object is to estimate the proportion of the country that will vote to keep the current government in power. You have been told to collect a sample and find a 95% confidence interval for the proportion. This interval is allowed to have a margin of error of 4%. A preliminary investigation suggests that the proportion of people that will vote to keep the current government...
You have been given the task of finding out what proportion of students that enroll in...
You have been given the task of finding out what proportion of students that enroll in a local university actually complete their degree. You have access to first year enrolment records and you decide to randomly sample 115 of those records. You find that 87 of those sampled went on to complete their degree. a)Calculate the proportion of sampled students that complete their degree. Give your answer as a decimal to 3 decimal places. Sample proportion = You decide to...
You have been given the task of organizing a poll regarding an upcoming election. The object...
You have been given the task of organizing a poll regarding an upcoming election. The object is to estimate the proportion of the country that will vote to keep the current government in power. You have been told to collect a sample and find a 95% confidence interval for the proportion. This interval is allowed to have a margin of error of 4%. A preliminary investigation suggests that the proportion of people that will vote to keep the current government...
You have been given the task of finding out what proportion of students that enroll in...
You have been given the task of finding out what proportion of students that enroll in a local university actually complete their degree. You have access to first year enrolment records and you decide to randomly sample 111 of those records. You find that 80 of those sampled went on to complete their degree. a)Calculate the proportion of sampled students that complete their degree. Give your answer as a decimal to 3 decimal places. Sample proportion = You decide to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT