Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tl;dr:
- convoltional > dense shallow, mas sem ganho real de performance nos testes (modelos começam a dar overfit sem ganho em valid/test). precisa de mais imgs? data augmentation (flips/whatever)?
- melhor modelo (considerando a ROC) foi CNN_4F5K144_G7 0.772 precision, 0.753 accuracy.
- 10-fold cross-validation ROC tradeoffs (https://i.imgur.com/y52DA4V.png):
- 1% FP -> 60.1% TP
- 3% FP -> 69.8% TP
- 5% FP -> 74.7% TP
- 9% FP -> 80.3% TP
- provavelmente razoável aceitar 3% FP, se usar esse como modelo final?
- garbage in -> garbage out? como avaliar essas imgs?
- https://imgur.com/a/yd1NDDv
- atual split de imagens boas/ruins:
- Jersey_1 | Good: 575 | Bad: 92 | 86.21% (575/667)
- Jersey_2 | Good: 203 | Bad: 91 | 69.05% (203/294)
- Jersey_3 | Good: 408 | Bad: 90 | 81.93% (408/498)
- Puruna_1-P1 | Good: 51 | Bad: 376 | 11.94% (51/427)
- Puruna_1-P2 | Good: 58 | Bad: 390 | 12.95% (58/448)
- Puruna_2 | Good: 129 | Bad: 1167 | 9.954% (129/1296)
- Puruna_3 | Good: 123 | Bad: 1670 | 6.86% (123/1793)
- USP-P1 | Good: 307 | Bad: 28 | 91.64% (307/335)
- USP-P2 | Good: 265 | Bad: 45 | 85.48% (265/310)
- USP-P3 | Good: 325 | Bad: 17 | 95.03% (325/342)
- Total | Good: 2444 | Bad: 3966 | 38.13% (2444/6410)
- mais detalhes do conv training:
- modelos simples (modelo final 242 KB!):
- Model: "conv_simple"
- _________________________________________________________________
- Layer (type) Output Shape Param #
- =================================================================
- conv2d_1 (Conv2D) (None, 140, 140, 4) 104
- _________________________________________________________________
- max_pooling2d_1 (MaxPooling2 (None, 70, 70, 4) 0
- _________________________________________________________________
- conv2d_2 (Conv2D) (None, 66, 66, 8) 808
- _________________________________________________________________
- max_pooling2d_2 (MaxPooling2 (None, 33, 33, 8) 0
- _________________________________________________________________
- flatten_1 (Flatten) (None, 8712) 0
- _________________________________________________________________
- dense_1 (Dense) (None, 2) 17426
- =================================================================
- Total params: 18,338
- Trainable params: 18,338
- Non-trainable params: 0
- alguns plots de treinamento:
- https://i.imgur.com/gjnPft7.png
- https://i.imgur.com/e4rlvJF.png
- https://i.imgur.com/QUlPmc0.png
- https://i.imgur.com/PpiSlDB.png
- https://i.imgur.com/eLE0xa0.png
- testei vários modelos pequenos e alguns poucos maiores (conv, connected). overfit, ou atinge maxima sem melhorar valid/teste, ou o que seja... melhores modelos shallow-conv.
- tentei resolver o overfit diminuindo a capacidade do modelo (input size, tamanho dos filtros), não ajudou de verdade.
- dropout também não melhorou, não que eu esperasse que fosse ajudar com um modelo tão shallow... (se bem que agora veio a ideia, faz um razoavelmente deep e coloca dropouts? parece não valer muito a pena)
- callbacks para pegar os modelos mais razoáveis (pre-superoverfit).
- alguns logs dos melhores modelos (melhor modelo no final do arquivo):
- Currently training: CNN_4F5K144_F9.h5
- explicação do naming:
- 4F = 4 filtros na primeira camada
- 5K = kernel 5x5
- F = split train/valid/test F (eu tentei várias divisões... chamei de A, B, C, D, E, F, G. definição do F nas linhas a seguir)
- 9 = número de epochs
- SPLIT_F = [[DF+'Puruna_2', DF+'Puruna_3', DF+'Jersey_2', DF+'USP-P1'],
- [DF+'Puruna_1-P1', DF+'Jersey_3', DF+'USP-P3'],
- [DF+'Puruna_1-P2', DF+'Jersey_1', DF+'USP-P2']]
- train 3718, valid 1267, test 1425
- test ratio = 898/1425, 63% boas
- Train on 3718 samples, validate on 1267 samples
- 3718/3718 [==============================] - 1s 228us/step - loss: 0.2085 - accuracy: 0.9236 - val_loss: 0.4343 - val_accuracy: 0.8114
- Acc: 0.776 | Pre: 0.854 | Sample: 143
- Acc: 0.748 | Pre: 0.821 | Sample: 143
- Acc: 0.762 | Pre: 0.850 | Sample: 143
- Acc: 0.769 | Pre: 0.890 | Sample: 143
- Acc: 0.762 | Pre: 0.826 | Sample: 143
- Acc: 0.739 | Pre: 0.827 | Sample: 142
- Acc: 0.768 | Pre: 0.852 | Sample: 142
- Acc: 0.704 | Pre: 0.718 | Sample: 142
- Acc: 0.725 | Pre: 0.719 | Sample: 142
- Acc: 0.599 | Pre: 0.629 | Sample: 142
- ==
- EndAcc: 0.735 | EndPre: 0.799 | Sample: 1425
- ROC (AUC = 0.88 +- 0.07):
- https://i.imgur.com/E1osnBs.png
- Currently training: CNN_4F5K144_F8.h5
- Train on 3718 samples, validate on 1267 samples
- 3718/3718 [==============================] - 1s 218us/step - loss: 0.1975 - accuracy: 0.9317 - val_loss: 0.5795 - val_accuracy: 0.8106
- Acc: 0.643 | Pre: 0.767 | Sample: 143
- Acc: 0.769 | Pre: 0.835 | Sample: 143
- Acc: 0.727 | Pre: 0.823 | Sample: 143
- Acc: 0.797 | Pre: 0.896 | Sample: 143
- Acc: 0.699 | Pre: 0.770 | Sample: 143
- Acc: 0.697 | Pre: 0.813 | Sample: 142
- Acc: 0.697 | Pre: 0.831 | Sample: 142
- Acc: 0.718 | Pre: 0.731 | Sample: 142
- Acc: 0.704 | Pre: 0.708 | Sample: 142
- Acc: 0.627 | Pre: 0.645 | Sample: 142
- ==
- EndAcc: 0.708 | EndPre: 0.782 | Sample: 1425
- ROC (AUC = 0.87 +- 0.06):
- https://i.imgur.com/qrobF3t.png
- SPLIT_G = [[DF+'Puruna_1-P1', DF+'Puruna_3', DF+'Jersey_2', DF+'USP-P2'],
- [DF+'Puruna_1-P2', DF+'Jersey_1', DF+'USP-P3'],
- [DF+'Puruna_2', DF+'USP-P1', DF+'Jersey_3']]
- train 2824, valid 1457, test 2129
- test ratio = 844/2129, 39% boas
- Currently training: CNN_4F5K144_G3.h5
- Train on 2824 samples, validate on 1457 samples
- 2824/2824 [==============================] - 1s 219us/step - loss: 0.3277 - accuracy: 0.8792 - val_loss: 0.5593 - val_accuracy: 0.7467
- Acc: 0.629 | Pre: 0.636 | Sample: 213
- Acc: 0.728 | Pre: 0.800 | Sample: 213
- Acc: 0.831 | Pre: 0.802 | Sample: 213
- Acc: 0.883 | Pre: 0.849 | Sample: 213
- Acc: 0.850 | Pre: 0.817 | Sample: 213
- Acc: 0.850 | Pre: 0.833 | Sample: 213
- Acc: 0.822 | Pre: 0.735 | Sample: 213
- Acc: 0.873 | Pre: 0.852 | Sample: 213
- Acc: 0.822 | Pre: 0.756 | Sample: 213
- Acc: 0.448 | Pre: 0.408 | Sample: 212
- ==
- EndAcc: 0.773 | EndPre: 0.749 | Sample: 2129
- ROC (AUC = 0.90 +- 0.15):
- https://i.imgur.com/4jIkdzN.png
- Currently training: CNN_4F5K144_G7.h5
- Train on 2824 samples, validate on 1457 samples
- 2824/2824 [==============================] - 1s 219us/step - loss: 0.2121 - accuracy: 0.9249 - val_loss: 0.5539 - val_accuracy: 0.7454
- Acc: 0.685 | Pre: 0.781 | Sample: 213
- Acc: 0.728 | Pre: 0.737 | Sample: 213
- Acc: 0.831 | Pre: 0.810 | Sample: 213
- Acc: 0.817 | Pre: 0.780 | Sample: 213
- Acc: 0.817 | Pre: 0.817 | Sample: 213
- Acc: 0.859 | Pre: 0.814 | Sample: 213
- Acc: 0.836 | Pre: 0.769 | Sample: 213
- Acc: 0.859 | Pre: 0.821 | Sample: 213
- Acc: 0.854 | Pre: 0.798 | Sample: 213
- Acc: 0.434 | Pre: 0.403 | Sample: 212
- ==
- EndAcc: 0.772 | EndPre: 0.753 | Sample: 2129
- ROC (AUC = 0.90 +- 0.14):
- https://i.imgur.com/y52DA4V.png
Add Comment
Please, Sign In to add comment