changing a mistake

This commit is contained in:
Kamila Bobkowska 2020-05-11 09:35:47 +00:00
parent a50df05eeb
commit e4e4a22bb3
1 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,7 @@ Per dumpster we assume that:
* there is from 0 to 2 incorrectly sorted trash
Before running the program it is need to unzip the "Garbage classifier.rar" file in the place where the rest of the files is.
The assessment of correctness is performed by a Convolutional Neural network. From the initial idea the types of trash changed. Now the Garbage truck will recognize between the following five kinds of debris:
* paper
* plastic
@ -28,7 +29,7 @@ classifier.add(MaxPooling2D(pool_size=(2, 2)))
classifier.add(Flatten())
classifier.add(Dense(activation = "relu", units = 64 ))
classifier.add(Dense(activation = "softmax", units = 5))
classifier.compile(optimizer = "adam", loss = "binary_crossentropy", metrics = ["accuracy"])
classifier.compile(optimizer = "adam", loss = "categorical_crossentropy", metrics = ["accuracy"])
```
After that I did some work with preprocessing the images I was working with. Made sure that the size is still (110, 110). set a batch size, allowed for flips and such.
@ -48,13 +49,16 @@ Later I trained my classifier and saved it's weights for future use in the proje
**UPDATE:**
I tried running it once again with more epochs and steps per epoch and get a better resulat and I think a better validation loss than before.
**UPDATE:**
Fixing my mistake of choosing an incorrect loss function which produced false accuracy.
```
classifier.fit_generator( train_generator, steps_per_epoch = 165, epochs = 32, validation_data = test_generator )
classifier.save_weights('model_ver_5.h5')
classifier.save_weights('model_ver_6.h5')
```
Training:
![Example](https://i.imgur.com/HBBvWCM.png)
![Example](https://i.imgur.com/9dsg5ZN.png)
## Changes in the common part