Data Mining Assignment 1
Building Image Classifier
Here we are creating the connection and directories in the Google Drive, where we are going to
download and save the files from Kaggle.
Installing the required packages and other files for downloading the files from Kaggle.
Downloading the files from Kaggle.
Importing the required packages from Tensorflow
Here we are intiliasing the CNN classifier, adding the required convolution layers with 32
kernels of 3X3 shape and adding max pooling layers. After these steps we are adding a fully
connected layer with 512 neurons.
For the prediction of categorical classification, we are adding dropout with probability of 0.5,
adding another fully connected layer with 128 neurons and the final output layers with 3
neurons.
Finally, we are compiling the model which we have created in the preceding steps.
After creating the model, we are now creating the data generator for the training data for the
ImageDataGenerator. We are resizing all the images to 32X32 images which the model input
layer expects.
Visualizing the data and metrics produced by the model trained.
Creating and plotting the new figure for the accuracies.
Loading the pre-trained saved model
ľesting the model on a test image fíom one of the test foldeís
Generating the report on the test data.
Importing required packages for using the pre-trained model called VGG-Net
Loading the datasets of images and classes.
Final image output.
We can observe from the above output images that our pre-trained model makes the
predictions quite correctly.
References:
https://stackoverflow.com/questions/65357934/having-error-
messages-for-importing-tensorflow-package-even-after-installing-it
http://pyimagesearch3.rssing.com
http://pyimagesearch30.rssing.com
https://www.zditect.com/