-
Notifications
You must be signed in to change notification settings - Fork 1
/
VGG16 - kimwoonggon
75 lines (63 loc) · 4.04 KB
/
VGG16 - kimwoonggon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
VGG16 model transfer learning
- Train data
train 451 images belonging to 3 classes
- Test data
152 images belonging to 3 classes
Augmentation - keras ImageDataGenerator
rescale = 1./128
rotation_range=20
horizontal_flip=True
vertical_flip=True
batch_size = 10
step_per_epoch_train = 402//10 * 20
- Fully connected layer
VGG16 MODEl + 256 NN Layers - Dropout(0.5) - 3 NN layers + softmax classifier
- Adam, learning_rate = 1e-5
Epoch 1/200
800/800 [==============================] - 105s 131ms/step - loss: 0.7238 - categorical_accuracy: 0.7321 - val_loss: 0.4074 - val_categorical_accuracy: 0.8698
Epoch 2/200
800/800 [==============================] - 102s 128ms/step - loss: 0.4051 - categorical_accuracy: 0.8671 - val_loss: 0.4108 - val_categorical_accuracy: 0.8385
Epoch 3/200
800/800 [==============================] - 104s 130ms/step - loss: 0.3161 - categorical_accuracy: 0.8893 - val_loss: 0.4431 - val_categorical_accuracy: 0.8490
Epoch 4/200
800/800 [==============================] - 103s 129ms/step - loss: 0.2617 - categorical_accuracy: 0.9116 - val_loss: 0.3284 - val_categorical_accuracy: 0.8424
Epoch 5/200
800/800 [==============================] - 103s 128ms/step - loss: 0.2251 - categorical_accuracy: 0.9255 - val_loss: 0.3378 - val_categorical_accuracy: 0.8437
Epoch 6/200
800/800 [==============================] - 105s 131ms/step - loss: 0.1972 - categorical_accuracy: 0.9363 - val_loss: 0.3741 - val_categorical_accuracy: 0.7865
Epoch 7/200
800/800 [==============================] - 103s 128ms/step - loss: 0.1712 - categorical_accuracy: 0.9468 - val_loss: 0.4224 - val_categorical_accuracy: 0.8125
Epoch 8/200
800/800 [==============================] - 103s 128ms/step - loss: 0.1493 - categorical_accuracy: 0.9566 - val_loss: 0.3353 - val_categorical_accuracy: 0.8424
Epoch 9/200
800/800 [==============================] - 103s 129ms/step - loss: 0.1353 - categorical_accuracy: 0.9591 - val_loss: 0.3699 - val_categorical_accuracy: 0.8385
Epoch 10/200
800/800 [==============================] - 104s 130ms/step - loss: 0.1272 - categorical_accuracy: 0.9621 - val_loss: 0.3278 - val_categorical_accuracy: 0.8438
Epoch 11/200
800/800 [==============================] - 103s 129ms/step - loss: 0.1043 - categorical_accuracy: 0.9742 - val_loss: 0.4335 - val_categorical_accuracy: 0.8073
Epoch 12/200
800/800 [==============================] - 104s 130ms/step - loss: 0.0964 - categorical_accuracy: 0.9756 - val_loss: 0.3656 - val_categorical_accuracy: 0.8587
Epoch 13/200
800/800 [==============================] - 106s 132ms/step - loss: 0.0843 - categorical_accuracy: 0.9811 - val_loss: 0.3856 - val_categorical_accuracy: 0.8229
Epoch 14/200
800/800 [==============================] - 104s 131ms/step - loss: 0.0789 - categorical_accuracy: 0.9822 - val_loss: 0.4018 - val_categorical_accuracy: 0.8229
Epoch 15/200
800/800 [==============================] - 104s 130ms/step - loss: 0.0714 - categorical_accuracy: 0.9846 - val_loss: 0.4881 - val_categorical_accuracy: 0.8073
Epoch 16/200
800/800 [==============================] - 106s 133ms/step - loss: 0.0643 - categorical_accuracy: 0.9874 - val_loss: 0.4354 - val_categorical_accuracy: 0.8533
Epoch 17/200
800/800 [==============================] - 106s 133ms/step - loss: 0.0579 - categorical_accuracy: 0.9886 - val_loss: 0.4530 - val_categorical_accuracy: 0.8385
Epoch 18/200
800/800 [==============================] - 106s 133ms/step - loss: 0.0512 - categorical_accuracy: 0.9909 - val_loss: 0.3966 - val_categorical_accuracy: 0.8490
Epoch 19/200
800/800 [==============================] - 104s 130ms/step - loss: 0.0479 - categorical_accuracy: 0.9915 - val_loss: 0.5350 - val_categorical_accuracy: 0.8229
Epoch 20/200
800/800 [==============================] - 104s 130ms/step - loss: 0.0446 - categorical_accuracy: 0.9930 - val_loss: 0.4943 - val_categorical_accuracy: 0.8533
Confusion matrix:
[[67 6 0]
[10 5 5]
[ 0 3 56]]
precision recall f1-score support
0 0.87 0.92 0.89 73
1 0.36 0.25 0.29 20
2 0.92 0.95 0.93 59