Machine Learning

Week 6 Update

share

Our aim this week was to finalize the code in which we performed certain operations on the csv file in the third week and to calculate an accuracy with our initial values.

First, we added the photos in our dataset to our list called “data” by going through some processes. We kept the indexes of the columns where no photos could be found in a list and printed them.

Secondly, we performed some operations to include the columns that our model should handle while learning in a new list called labels.

We converted our data and labels lists into numpy arrays. We applied normalization while transforming the data list.

We converted our labels list to binary using a MultiLabelBinarizer. We also got all the class values we had with the mlb.classes_ code.

Afterwards, we designed our main model by creating a CNN model. (This CNN model is for our trial this week. Next week, we will calculate the accuracy again over different CNN models and parameters and decide on our final model.)

Then, for the learning phase, we divided our dataset into train and test and left 20% of the data for the test set.

We trained the model in batches of 32 for 50 epochs.

Finally, to see the success of our model, we took the predictions with model.predict and calculated the success of our model after some processes.

–Karışık Değerlere Ait Fotoğraf-

When we printed the actual and predicted values, we observed that the order we wanted was disrupted and some predictions were under- or over-done.
For this reason, after performing some filtering operations on the two labels, we recalculated the success of the model without making any new predictions. As a result of this calculation, the success of our model increased noticeably.