Skip to content

Instantly share code, notes, and snippets.

@aziyan99
Last active October 26, 2023 14:10
Show Gist options
  • Save aziyan99/ed4cdfd9403805a2530c69034f3cbbac to your computer and use it in GitHub Desktop.
Save aziyan99/ed4cdfd9403805a2530c69034f3cbbac to your computer and use it in GitHub Desktop.
PITG Mangrove cnn training logs
# Arsitektur (Tensorflow-python):
```
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d_9 (Conv2D) (None, 148, 148, 32) 896
max_pooling2d_9 (MaxPoolin (None, 74, 74, 32) 0
g2D)
conv2d_10 (Conv2D) (None, 72, 72, 64) 18496
max_pooling2d_10 (MaxPooli (None, 36, 36, 64) 0
ng2D)
conv2d_11 (Conv2D) (None, 34, 34, 128) 73856
max_pooling2d_11 (MaxPooli (None, 17, 17, 128) 0
ng2D)
flatten_3 (Flatten) (None, 36992) 0
dense_6 (Dense) (None, 512) 18940416
dense_7 (Dense) (None, 8) 4104
=================================================================
Total params: 19037768 (72.62 MB)
Trainable params: 19037768 (72.62 MB)
Non-trainable params: 0 (0.00 Byte)
_________________________________________________________________
```
Datasets training:
Class: Avicennia alba, Count: 1
Class: Bruguiera cylindrica, Count: 1
Class: Bruguiera gymnorrhiza, Count: 1
Class: Lumnitzera littorea, Count: 1
Class: Rhizophora apiculata, Count: 1
Class: Rhizophora mucronata, Count: 1
Class: Sonneratia alba, Count: 1
Class: Xylocarpus granatum, Count: 1
=================================================================
Total training data : 1590
Total test/validation data : 1590
Total Class : 8
Preproses data dengan augmentasi data:
shear_range=0.2, # apply shear
zoom_range=0.2, # apply zoom
horizontal_flip=True, # flip horizontally
otation_range=10, # Random rotation up to 10 degrees
width_shift_range=0.1, # Randomly shift the width by 10%
height_shift_range=0.1, # Randomly shift the height by 10%
brightness_range=[0.8, 1.2], # Randomly adjust brightness between 0.8 - 1.2
fill_mode='nearest' # Fill any newly created pixels after rotation or shifting
Logs training:
Epoch 1/12
398/398 [==============================] - 336s 844ms/step - loss: 1.7704 - accuracy: 0.3214 - val_loss: 1.5847 - val_accuracy: 0.3748
Epoch 2/12
398/398 [==============================] - 335s 842ms/step - loss: 1.4111 - accuracy: 0.4648 - val_loss: 1.2516 - val_accuracy: 0.5478
Epoch 3/12
398/398 [==============================] - 341s 856ms/step - loss: 1.2305 - accuracy: 0.5321 - val_loss: 1.1998 - val_accuracy: 0.5597
Epoch 4/12
398/398 [==============================] - 326s 819ms/step - loss: 1.0469 - accuracy: 0.6050 - val_loss: 0.8933 - val_accuracy: 0.6604
Epoch 5/12
398/398 [==============================] - 332s 835ms/step - loss: 0.9644 - accuracy: 0.6509 - val_loss: 0.7333 - val_accuracy: 0.7245
Epoch 6/12
398/398 [==============================] - 347s 873ms/step - loss: 0.8167 - accuracy: 0.7057 - val_loss: 0.5938 - val_accuracy: 0.7717
Epoch 7/12
398/398 [==============================] - 328s 824ms/step - loss: 0.7592 - accuracy: 0.7226 - val_loss: 0.5545 - val_accuracy: 0.7981
Epoch 8/12
398/398 [==============================] - 335s 842ms/step - loss: 0.6543 - accuracy: 0.7717 - val_loss: 0.4794 - val_accuracy: 0.8283
Epoch 9/12
398/398 [==============================] - 323s 812ms/step - loss: 0.5886 - accuracy: 0.7887 - val_loss: 0.5851 - val_accuracy: 0.8604
Epoch 10/12
398/398 [==============================] - 334s 839ms/step - loss: 0.5665 - accuracy: 0.8088 - val_loss: 0.3443 - val_accuracy: 0.8761
Epoch 11/12
398/398 [==============================] - 364s 915ms/step - loss: 0.4949 - accuracy: 0.8289 - val_loss: 0.2545 - val_accuracy: 0.9270
Epoch 12/12
398/398 [==============================] - 365s 916ms/step - loss: 0.4363 - accuracy: 0.8497 - val_loss: 0.2362 - val_accuracy: 0.9258
Lama training dengan 12 epochs : 1jam 3 menit
Akurasi terakhir : 0.8497
class:
0: Avicennia alba
1: Bruguiera cylindrica
2: Bruguiera gymnorrhiza
3: Lumnitzera littorea
4: Rhizophora apiculata
5: Rhizophora mucronata
6: Sonneratia alba
7: Xylocarpus granatum
Confusion Matrix:
[[ 77 21 110 65 21 44 29 18]
[ 10 1 17 11 3 4 3 3]
[ 96 17 109 79 25 46 29 26]
[ 47 7 56 31 8 31 10 11]
[ 29 8 52 22 5 15 4 8]
[ 38 11 56 32 10 20 14 10]
[ 23 5 31 12 5 15 5 4]
[ 16 5 20 23 8 13 4 2]]
Classification Report:
precision recall f1-score support
0 0.23 0.20 0.21 385
1 0.01 0.02 0.02 52
2 0.24 0.26 0.25 427
3 0.11 0.15 0.13 201
4 0.06 0.03 0.04 143
5 0.11 0.10 0.11 191
6 0.05 0.05 0.05 100
7 0.02 0.02 0.02 91
accuracy 0.16 1590
macro avg 0.10 0.11 0.10 1590
weighted avg 0.16 0.16 0.16 1590
Test predict with 10 images:
=================
Xylocarpus granatum
1/1 [==============================] - 0s 23ms/step
The predicted class for PA090338.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA090380.JPG is: ['Xylocarpus granatum']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_8153.JPG is: ['Xylocarpus granatum']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA090379.JPG is: ['Xylocarpus granatum']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_8154.JPG is: ['Xylocarpus granatum']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA090340.JPG is: ['Xylocarpus granatum']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA090378.JPG is: ['Xylocarpus granatum']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA090339.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 26ms/step
The predicted class for PA090343.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 25ms/step
The predicted class for PA090381.JPG is: ['Xylocarpus granatum']
=================
Lumnitzera littorea
1/1 [==============================] - 0s 24ms/step
The predicted class for PA150461.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 26ms/step
The predicted class for IMG_8336.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_8335.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_8279.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_8277.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 25ms/step
The predicted class for IMG_8280.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_8276.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_8278.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA150457.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA150456.JPG is: ['Lumnitzera littorea']
=================
Bruguiera gymnorrhiza
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7945.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 26ms/step
The predicted class for IMG_7938.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7948.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA090278.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_8009.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7930.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 27ms/step
The predicted class for IMG_7934.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 29ms/step
The predicted class for IMG_7896.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA090174.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_7952.JPG is: ['Bruguiera gymnorrhiza']
=================
Sonneratia alba
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080486.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 30ms/step
The predicted class for IMG_7663.JPG is: ['Bruguiera gymnorrhiza']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080585.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 22ms/step
The predicted class for PA080519.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_7664.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080579.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080581.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7668.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 22ms/step
The predicted class for PA080580.JPG is: ['Sonneratia alba']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080577.JPG is: ['Sonneratia alba']
=================
Bruguiera cylindrica
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_8517.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_8568.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_8567.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 26ms/step
The predicted class for IMG_8565.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_8555.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 28ms/step
The predicted class for IMG_8523.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_8520.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 25ms/step
The predicted class for IMG_8553.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_8519.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_8554.JPG is: ['Bruguiera cylindrica']
=================
Avicennia alba
1/1 [==============================] - 0s 29ms/step
The predicted class for PA080269.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080317.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080404.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080201.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080382.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080483.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080423.JPG is: ['Bruguiera cylindrica']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080365.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 26ms/step
The predicted class for PA080447.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080313.JPG is: ['Avicennia alba']
=================
Rhizophora mucronata
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080194.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080091.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080090.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080088.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080153.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 25ms/step
The predicted class for PA080089.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080191.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 23ms/step
The predicted class for PA080192.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 24ms/step
The predicted class for PA080195.JPG is: ['Rhizophora mucronata']
1/1 [==============================] - 0s 22ms/step
The predicted class for PA080092.JPG is: ['Bruguiera gymnorrhiza']
=================
Rhizophora apiculata
1/1 [==============================] - 0s 22ms/step
The predicted class for IMG_7852.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 25ms/step
The predicted class for IMG_7854.JPG is: ['Avicennia alba']
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_7851.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7813.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 23ms/step
The predicted class for IMG_7815.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 26ms/step
The predicted class for IMG_7855.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 25ms/step
The predicted class for IMG_7812.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7814.JPG is: ['Lumnitzera littorea']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7859.JPG is: ['Rhizophora apiculata']
1/1 [==============================] - 0s 24ms/step
The predicted class for IMG_7853.JPG is: ['Rhizophora mucronata']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment