Seniord.cs.iastate.edu



Edge Detection and Prediction ModelsComS 402 Omima HassanStage 1: Ask a QuestionThis report will be focusing on analyzing two different image processing techniques, edge detection and prediction models. The data observed in this project consisted of images of furniture and home goods. Using the datasets, I wanted to be able to answer these two questions:How well can an image be detected based on its edges?When given a testing image, can an image classification model accurately predict which category the image belongs to?A benefit is to be able to find out whether an image classification model is feasible in accurately predicting household items such as furniture.?? ? ? ? ? ?Stage 2: Get the DataFor this experiment, I am using two different datasets, both of which contained similar items but presented in different formats. The datasets that I used can be found on Kaggle, an online platform filled with datasets. The first dataset had three different JSON files, a train, test, and validation set. The files contained URLs of furniture and home goods. While the second dataset also consisted of images that fell into five different categories of furniture, beds, sofas, chairs, swivel chairs, and tables that were in the format of jpg files. Because of the similarities between the datasets, I was able to perform different image processing techniques on each dataset without answers being unrelated to one another. Both datasets had lots of information contained within and were accessible to use, which made data cleaning less of a hassle.Stage 3: Explore the DataUsing the first dataset, the first technique that I am using is edge detection. I wanted a way to be able to detect edges from a given URL image in hopes of determining what the image resembled. Edge detection is a useful technique because we are not looking for the specific features of an image but instead the overall shape. The shape of an image can distinguish it from other items, in this case, other household items. This technique also helps in decreasing the amount of storage that is needed to use, due to images being in black and white and not color. By detecting the edges of an image, we are doing away with much of the detail. This makes the image lightweight and comes in handy when all we need is the overall shape and not the intricate details of an image. Figure 1 shows the original bed image before its edges were detected, while figure 2 shows how the image would look if we were only looking at its borders. 36652202184400Figure 2Figure 23680460762000Figure SEQ Figure \* ARABIC 1With the use of the second dataset, I am using a convolutional neural network to predict model accuracy. Table 1 shows the items and the amounts used for the training and testing datasets while table 2 shows the different layers and the roles each layer plays in order build this CNN.Table SEQ Table \* ARABIC 1ItemAmount of Training ImagesAmount of Validation ImagesBed900100Chair900100Sofa900100Swivel Chair900100Table900100Table SEQ Table \* ARABIC 2Conv2DCreates a convolution kernel which helps produce a tensor of outputsActivationA node that is put at the end or between neural networks that helps decide if the neuron would send out an input signalMaxPooling2DReduces the number of parameters within a modelDropoutPrevents model from overfittingFlattenTransforms a two-dimensional matrix of features into a vectorDenseRegular layer of neurons in a neural networkStage 4: Model the DataFrom the first dataset, edge detection uses two features to detect the outline of an image, KNN and a Sobel operator. These features in conjunction with NumPy, a python package that provides a high-performance multidimensional array object and tools for working with arrays. The KNN algorithm is used when the pixels from an image are classified into two categories. 0 classifying black and 1 being white, these binary numbers are then put into a multidimensional matrix using NumPy. Looking at figure 3 we can see that a red square was outlined inside the matrix, the numbers within the square are now considered as part of an edge of a given image. We then use a Sobel operator to detect the type of direction the image is. Either in the vertical or horizontal direction. In this figures case the image is considered in the vertical direction. Figure 3From the second dataset, I wanted to be able to predict model accuracy in classifying images based on the categories given. I was able to achieve this building an image classification model using packages such as TensorFlow and Keras to make a convolutional neural network.I created a training set based on the different categories of furniture; each category contained several images of that item. I choose to split the data 90:10 so that my model would generalize better due to it having more data to train. After doing so, I created a file containing information about the model. I then began building the model, which had three convolutional layers. After initializing these layers, the model was then able to compile using basic parameters, and training began . I choose to train the model with 40 iterations, and the validation split corresponded to the percentage of images used for the validation phased compared to all the other images. To use the model again, it had to be saved into three different formats. The first being a JSON file, the second a model that could be saved to the disk, and the third the CNN that would be later used for model predictions. Figure 4 below shows the accuracy changes during the training phase. This graph depicts how accurately this model was able to predict the training images to the validation images. Figure 4Stage 5: Communicate the dataI used edge detection , a technique used for image segmentation and data extraction in areas such as image processing, computer vision, and machine vision. While also making use of a convolutional neural network that has been proven very effective in areas such as image recognition and classification. Using these two techniques has proved useful in determining whether images can be detected and classified correctly using different machine learning techniques. Many resources aided in coming up with these conclusions, some of which also provided useful snippets of code in python to aid in the creation of the two image processing techniques.After seeing the results of this project, I can conclude that mage processing techniques help in gathering accurate information and not just in the domain of furniture and home goods but any domain of available images. The only disadvantage both techniques would have is falsely classifying an image due to a clear representation of an item. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download