‫Now, we are going to start with a complete end to end project. In this project.
‫We will try to classify colored images of cats and dogs.
‫So if take up dataset from Cegal, Cegal is a website where a lot of data science competitions are
‫being held.
‫There was a competition which was held in 2003 in which thousands of images of cats and dogs were given
‫and a model was to be built to classify those images into cats and dogs.
‫The best accuracy achieved in that competition was nearly ninety eight percent.
‫We are going to use a subset of that data and try to build our model and will try to achieve over
‫90 percent accuracy with our model.
‫Here are some of the details of this project.
‫This is a binary classification problem, unlike fashion amnesty in which there were 10 categories to
‫be predicted.
‫Here we have only two.
‫Either that image is of a cat or it is of a dog.
‫So only two classes.
‫That is why it is a binary classification problem.
‫Then this is a data set of coloured images.
‫That is, we will have three channels R G and B instead of only one channel.
‫As we have amnesty data set
‫We do not have a standard dimension of all these images.
‫As you saw in the previous project, we were using 28 by 28 pixel images.
‫But here are dataset does not have one standard dimension.
‫So when we are feeding the data to our model, we will have to convert the images to one standard dimension.
‫So that is one additional step.
‫Then we are using a Caggle dataset.
‫If you are interested, you can go to the Caggle website and see this cat versus dog competition.
‫You can also see the leaderboard there.
‫How much accuracy people have achieved.
‫And you can compare your model with other people's model.
‫And the last point is we are going to use a subset of the total data.
‫The total data had over 50000 images in our model.
‫We are going to use only 4000 images, 2000 to train, 1000 for validation dataset and 1000 for
‫testing.
‫So using only this small part of the data, we are still going to achieve accuracy's, which are comparable
‫to the other models built by people in the competition.
‫So here is how we have structured the data.
‫These zip file that you download from the link that we have provided has 4000 images and those images
‫are structured in this format.
‫So the first folder will have three folders inside of it.
‫These three folders will be train, tighter, valid and tested
‫The train folder will further have two folders.
‫These folders will be cats and dogs.
‫So Class A here is cat and Class B is dogs.
‫And this folder, we will have thousand images of cats.
‫And in this folder, we will have thousand images of dogs.
‫Similarly, in validation dataset, there'll be two folders, one containing 500 images of cats, the
‫other containing 500 images of dogs in the testing dataset.
‫We'll have 1000 images.
‫So in total, there are 4000 images, 2000 will be used for training.
‫the Model 1000 will be used for validation set.
‫And the last 1000 images will be used for testing the accuracy on previously unseen data.
‫So the process we are going to follow while building this project is this first we will be creating
‫a CNN model with four convolutional layers.
‫So it will have four different convolutional ‫layers paired with pooling layers
‫And this model will be able to achieve accuracy in the range of 70 to 75 percent.
‫I'm talking about validation accuracy here.
‫So this model will be able to achieve somewhere between 70 to 75.
‫Then because we have a small dataset, we can improve the performance of our model by doing data augmentation.
‫Data augmentation is the process of creating artificial images using these small dataset that you have.
‫So in the second step, we will augment our data.
‫And then run our model again, for example, if you have this image of a cat, you can create a new
‫image by zooming in a small part of this image, or you can create a new image by rotating this image
‫of a cat.
‫And there are many more transformations that you can do to this image to create a similar image of a
‫cat using an existing image.
‫So using one image, you'll be able to create multiple images just by transforming the image a little
‫bit.
‫Transformations include linear transformations, rotations, zooming in, zooming out, etc..
‫So after you do this and you run the model again, you'll be able to achieve an accuracy over 80 percent.
‫Lastly, we'll use one of the architectures that we have discussed previously, and we will try to implement
‫those pre-learnt architectures to try to classify this dog vs cat dataset, using that Pre trained architecture
‫will be able to achieve an accuracy over 90 percent.
‫So after this project, you'll have understanding of how to import images, how to run binary or multiclass
‫classification using CNN and how to use Pre trained architectures to solve the problem that you have with
‫you.