responses

Powerpoint Presentation Weather Image Classification.pptx

Problem Statement The topic I chose to do was image classification on weather using convolutional neural networks. My objective is to use CNNs to correctly classify the type of weather an image belongs to. Depending on the complexity of this idea, image classification on weather is important because improving computer vision on things such as bad weather and limited visibility caused by weather like heavy rain, snow, or fog is crucial for things such as driving assistance. To improve machine vision in bad weather situations, a reliable detection system is necessary as a ground base. I want to see how well of a CNN model I can build and how accurately can I correctly classify images.

Data I used data from a multi-class weather dataset for image classification of still images. The dataset provides a platform for outdoor weather analysis by extracting various features for recognizing diferent weather conditons. It includes 1122 google stock images of different types of weather that falls into 4 categories: cloud (300), rain (212), sunrise (357), and shine (253).

Method When I downloaded the dataset, I split the dataset folder into 4 different subfolders within it that each corresponded to the type of class. After that, I made all the images the same size at 300x168 pixels. Then, I made code to import my data into pycharm. Next, I split my data into 80% training and 20% testing. I plotted the first 9 images of my training set to see the different classifications coresspond to an image seen here: first9trainingset. Now I configure the dataset for performace and standardize my images. I start building my first CNN model seen here: Screen Shot 2020-08-08 at 1 24 44 PM. I used 3 Conv2D layers, 3 MaxPooloing layers, 1 Flatten , and 2 Dense layers. I selected relu for my activation since it allows for faster and more effective training of deep neural networks. I compiled the model using adam as the optimizersince Adam combines the best properties of the AdaGrad and RMSProp algorithms to provide an optimization algorithm that can handle sparse gradients on noisy problems. I used SparseCategoricalCrossentropy for the loss function to compute the crossentropy loss between the labels and predictions and this one is used for when there or 2 or more label classes. For the metrics, I used accuracy as my goal is to produce the highest accuracy. Finally, I fitted the model with a batch size of 32 and 10 epochs. My results included:trainvalaccloss. My training accuracy was 94% and my testing accuarcy was 80%. In the graph you can see the training accuracy being a lot higher than the validation accuracy, the training loss is lower than the testing loss, and the fluctuation of the accuracies. These are all strong indicators that the model is well overfit. To combat the overfitting, I took my CNN model and added data augmentating and a Dropout layer since these are common ays to decrease the overfitting as seen here: Screen Shot 2020-08-08 at 1 25 30 PM. Then i compiled and fitted the model with the same arguments and got a little bit of better results as seen here: trainvalaccloss1. My training accurcy became 87% and my testing accuracy became 83%. So, the model is still overfit but not as much as before. These were the best results I could get at this time. Moving on, I decided to look up a few images on google that fall into the 4 different categories and decided to test my model on it to see how well it would do. my results included:

cloud1 Cloud1: This image most likely belongs to shine with a 34.94 percent confidence.

cloud2 Cloud2: This image most likely belongs to shine with a 70.09 percent confidence.

rain1 Rain1: This image most likely belongs to rain with a 100.00 percent confidence.

rain2 Rain2: This image most likely belongs to rain with a 100.00 percent confidence.

shine1 Shine1: This image most likely belongs to sunrise with a 96.31 percent confidence.

shine2 Shine2: This image most likely belongs to sunrise with a 85.76 percent confidence.

sunrise1 Sunrise1: This image most likely belongs to sunrise with a 99.83 percent confidence.

sunrise2 Sunrise2: This image most likely belongs to sunrise with a 100.00 percent confidence.

As you can see, my model correctly identified the 2 rain images, and sunrise images. The model incorrectly identified both cloud images to be in the shine category and it incorrectly indentified the 2 shine images to be in the sunrise category.

Conclusion If I had more time and did more trial and error, I am sure I could get better accuracies and less overfitting so that my model can run more efficiently. I do think my model did pretty well, however. I think I would also try different weather categories like snow. I would also like to increase the number of photos for each category so that it can have a wide variety of range of the different categories. Based of my results, it seems my model was getting the cloud images wrong probably due to the fact that it is a beautiful day and there’s light outside, making it think that it shine. And it was probably getting my shine pictures wrong because it saw the sun and classified it as sunrise. So picking categories that are more different would be another thing I would like to do.

References Ajayi, Gbeminiyi. “Multi-Class Weather Dataset for Image Classification.” Mendeley Data, Mendeley Data, 13 Sept. 2018, data.mendeley.com/datasets/4drtyfjtfy/1. Ajayi, Gbeminiyi. “Multi-Class Weather Dataset for Image Classification.” Mendeley Data, Mendeley Data, 13 Sept. 2018, dx.doi.org/10.17632/4drtyfjtfy.1. “Image Classification : TensorFlow Core.” TensorFlow, www.tensorflow.org/tutorials/images/classification.

Related Works https://www.mrt.kit.edu/z/publ/download/Roser_al2008iv.pdf https://www.researchgate.net/publication/331353178_Weather_Classification_using_Convolutional_Neural_Networks