Cainvas

Inventory Management using Deep Learning

In [ ]:
!wget -N "https://cainvas-static.s3.amazonaws.com/media/user_data/dvedprakash2/data_week1.zip"
!unzip -qo data_week1.zip 
!rm data_week1.zip

Installing prerequisites

In [ ]:
!pip3 install imgaug
In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os, random, cv2, pickle, json, itertools
import imgaug.augmenters as iaa
import imgaug.imgaug
import tensorflow as tf

from IPython.display import SVG
from tensorflow.keras.utils import plot_model, model_to_dot
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from collections import Counter
from sklearn.utils import class_weight
from tqdm import tqdm
from sklearn.preprocessing import LabelBinarizer

from tensorflow.keras.utils import to_categorical
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint, Callback, EarlyStopping
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import (Add, Input, Conv2D, Dropout, Activation, BatchNormalization, MaxPool2D, ZeroPadding2D, AveragePooling2D, Flatten, Dense)
from tensorflow.keras.optimizers import Adam, SGD
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint, Callback, EarlyStopping
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.initializers import *

Function to plot model metrics

In [2]:
def show_final_history(history):
    
    plt.style.use("ggplot")
    fig, ax = plt.subplots(1,2,figsize=(15,5))
    ax[0].set_title('Loss')
    ax[1].set_title('Accuracy')
    ax[0].plot(history.history['loss'],label='Train Loss')
    ax[0].plot(history.history['val_loss'],label='Validation Loss')
    ax[1].plot(history.history['accuracy'],label='Train Accuracy')
    ax[1].plot(history.history['val_accuracy'],label='Validation Accuracy')
    
    ax[0].legend(loc='upper right')
    ax[1].legend(loc='lower right')
    plt.show();
    pass

Identifying the dataset and classes

In [3]:
datasets = ['data_week1/images']

class_names = ["MILK","NUTS","OIL","SODA","TEA"]

class_name_labels = {class_name:i for i,class_name in enumerate(class_names)}

num_classes = len(class_names)
class_name_labels
Out[3]:
{'MILK': 0, 'NUTS': 1, 'OIL': 2, 'SODA': 3, 'TEA': 4}

Loading the data

In [4]:
def load_data():
    images, labels = [], []
    
    for dataset in datasets:
        
        for folder in os.listdir(dataset):
            label = class_name_labels[folder]
            
            for file in tqdm(os.listdir(os.path.join(dataset,folder))):
                
                img_path = os.path.join(dataset,folder,file)
                
                img = cv2.imread(img_path)
                img = cv2.resize(img, (96,96))
                
                images.append(img)
                labels.append(label)
                pass
            pass
        
        images = np.array(images,dtype=np.float32)/255.0
        labels = np.array(labels,dtype=np.float32)
        pass
    
    return (images, labels)
    pass
In [5]:
(images, labels) = load_data()
images.shape, labels.shape
100%|██████████| 168/168 [00:00<00:00, 419.93it/s]
100%|██████████| 177/177 [00:00<00:00, 361.77it/s]
100%|██████████| 162/162 [00:00<00:00, 362.56it/s]
100%|██████████| 283/283 [00:00<00:00, 356.55it/s]
100%|██████████| 143/143 [00:00<00:00, 373.81it/s]
Out[5]:
((933, 96, 96, 3), (933,))

Checking our classes

In [6]:
n_labels = labels.shape[0]

_, count = np.unique(labels, return_counts=True)

df = pd.DataFrame(data = count)
df['Class Label'] = class_names
df.columns = ['Count','Class-Label']
df.set_index('Class-Label',inplace=True)
df
Out[6]:
Count
Class-Label
MILK 162
NUTS 168
OIL 143
SODA 177
TEA 283

Augmenting images to prevent underfitting and remove bias in the dataset

In [7]:
def augment_add(images, seq, labels):
    
    augmented_images, augmented_labels = [],[]
    for idx,img in tqdm(enumerate(images)):
        
        if labels[idx] == 1:
            image_aug_1 = seq.augment_image(image=img)
            image_aug_2 = seq.augment_image(image=img)
            augmented_images.append(image_aug_1)
            augmented_images.append(image_aug_2)
            augmented_labels.append(labels[idx])
            augmented_labels.append(labels[idx])
        pass
    
    augmented_images = np.array(augmented_images, dtype=np.float32)
    augmented_labels = np.array(augmented_labels, dtype=np.float32)
    
    return (augmented_images, augmented_labels)
    pass
In [8]:
seq = iaa.Sequential([
    iaa.Fliplr(0.5),
    iaa.Crop(percent=(0,0.1)),
    iaa.LinearContrast((0.75,1.5)),
    iaa.Multiply((0.8,1.2), per_channel=0.2),
    iaa.Affine(
        scale={'x':(0.8,1.2), "y":(0.8,1.2)},
        translate_percent={"x":(-0.2,0.2),"y":(-0.2,0.2)},
        rotate=(-25,25),
        shear=(-8,8)
    )
], random_order=True)
In [9]:
(aug_images, aug_labels) = augment_add(images, seq, labels)
images = np.concatenate([images, aug_images])
labels = np.concatenate([labels, aug_labels])
933it [00:00, 1361.12it/s]
In [10]:
images.shape, labels.shape
Out[10]:
((1269, 96, 96, 3), (1269,))
In [11]:
labels = to_categorical(labels)

Dividing images into train,validation and test sets

In [12]:
np.random.seed(42)
np.random.shuffle(images)

np.random.seed(42)
np.random.shuffle(labels)
In [13]:
total_count = len(images)
total_count

train = int(0.7*total_count)
val = int(0.2*total_count)
test = int(0.1*total_count)

train_images, train_labels = images[:train], labels[:train]
val_images, val_labels = images[train:(val+train)], labels[train:(val+train)]
test_images, test_labels = images[-test:], labels[-test:]

train_images.shape, val_images.shape, test_images.shape
Out[13]:
((888, 96, 96, 3), (253, 96, 96, 3), (126, 96, 96, 3))

Defining model architecture

In [14]:
model = Sequential([
    Input(shape=(96,96,3)),
    ZeroPadding2D((5,5)),
    Conv2D(32, 3, activation='relu'),
    BatchNormalization(),
    MaxPool2D(pool_size=(2,2)),
    Dropout(0.3),
    Conv2D(32, 3, activation='relu'),
    MaxPool2D(pool_size=(2,2)),
    Dropout(0.3),
    Conv2D(32, 3, activation='relu'),
    MaxPool2D(pool_size=(2,2)),
    Dropout(0.4),
    Conv2D(32, 3, activation='relu'),
    MaxPool2D(pool_size=(2,2)),
    Dropout(0.3),
    Conv2D(32, 3, activation='relu'),
    MaxPool2D(pool_size=(2,2)),
    Dropout(0.3),
    Flatten(),
    Dense(64, activation='relu'),
    Dropout(0.5),
    Dense(5, activation='softmax')
])

model.summary()
Model: "sequential"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
zero_padding2d (ZeroPadding2 (None, 106, 106, 3)       0         
_________________________________________________________________
conv2d (Conv2D)              (None, 104, 104, 32)      896       
_________________________________________________________________
batch_normalization (BatchNo (None, 104, 104, 32)      128       
_________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 52, 52, 32)        0         
_________________________________________________________________
dropout (Dropout)            (None, 52, 52, 32)        0         
_________________________________________________________________
conv2d_1 (Conv2D)            (None, 50, 50, 32)        9248      
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 25, 25, 32)        0         
_________________________________________________________________
dropout_1 (Dropout)          (None, 25, 25, 32)        0         
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 23, 23, 32)        9248      
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 11, 11, 32)        0         
_________________________________________________________________
dropout_2 (Dropout)          (None, 11, 11, 32)        0         
_________________________________________________________________
conv2d_3 (Conv2D)            (None, 9, 9, 32)          9248      
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 4, 4, 32)          0         
_________________________________________________________________
dropout_3 (Dropout)          (None, 4, 4, 32)          0         
_________________________________________________________________
conv2d_4 (Conv2D)            (None, 2, 2, 32)          9248      
_________________________________________________________________
max_pooling2d_4 (MaxPooling2 (None, 1, 1, 32)          0         
_________________________________________________________________
dropout_4 (Dropout)          (None, 1, 1, 32)          0         
_________________________________________________________________
flatten (Flatten)            (None, 32)                0         
_________________________________________________________________
dense (Dense)                (None, 64)                2112      
_________________________________________________________________
dropout_5 (Dropout)          (None, 64)                0         
_________________________________________________________________
dense_1 (Dense)              (None, 5)                 325       
=================================================================
Total params: 40,453
Trainable params: 40,389
Non-trainable params: 64
_________________________________________________________________

Defining model callbacks and compiling the model with the Adam optimizer

In [15]:
checkpoint = ModelCheckpoint(
    './base.model',
    monitor='val_accuracy',
    verbose=1,
    save_best_only=True,
    mode='max',
    save_weights_only=False,
    save_frequency=1
)
earlystop = EarlyStopping(
    monitor='val_loss',
    min_delta=0.001,
    patience=50,
    verbose=1,
    mode='auto'
)

opt = Adam(lr=1e-3)

callbacks = [checkpoint,earlystop]

model.compile(optimizer=opt,loss='binary_crossentropy',metrics=['accuracy'])
In [16]:
epochs = 200
batch_size = 32

history = model.fit(train_images,train_labels,
                    batch_size=batch_size,
                   steps_per_epoch=len(train_images)//batch_size,
                   epochs=epochs,
                   verbose=1, 
                   validation_data=(val_images,val_labels),
                   validation_steps=len(val_images)//batch_size,
                   callbacks=callbacks
                   )
Epoch 1/200
26/27 [===========================>..] - ETA: 0s - loss: 0.5648 - accuracy: 0.3029
Epoch 00001: val_accuracy improved from -inf to 0.44196, saving model to ./base.model
WARNING:tensorflow:From /opt/tljh/user/lib/python3.7/site-packages/tensorflow/python/training/tracking/tracking.py:111: Model.state_updates (from tensorflow.python.keras.engine.training) is deprecated and will be removed in a future version.
Instructions for updating:
This property should not be used in TensorFlow 2.0, as updates are applied automatically.
WARNING:tensorflow:From /opt/tljh/user/lib/python3.7/site-packages/tensorflow/python/training/tracking/tracking.py:111: Layer.updates (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
This property should not be used in TensorFlow 2.0, as updates are applied automatically.
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 81ms/step - loss: 0.5621 - accuracy: 0.3009 - val_loss: 0.4977 - val_accuracy: 0.4420
Epoch 2/200
25/27 [==========================>...] - ETA: 0s - loss: 0.4765 - accuracy: 0.3699
Epoch 00002: val_accuracy did not improve from 0.44196
27/27 [==============================] - 0s 12ms/step - loss: 0.4780 - accuracy: 0.3692 - val_loss: 0.4921 - val_accuracy: 0.4420
Epoch 3/200
26/27 [===========================>..] - ETA: 0s - loss: 0.4767 - accuracy: 0.3653
Epoch 00003: val_accuracy did not improve from 0.44196
27/27 [==============================] - 0s 11ms/step - loss: 0.4762 - accuracy: 0.3645 - val_loss: 0.4904 - val_accuracy: 0.4420
Epoch 4/200
27/27 [==============================] - ETA: 0s - loss: 0.4575 - accuracy: 0.3902
Epoch 00004: val_accuracy did not improve from 0.44196
27/27 [==============================] - 0s 11ms/step - loss: 0.4575 - accuracy: 0.3902 - val_loss: 0.4874 - val_accuracy: 0.4420
Epoch 5/200
27/27 [==============================] - ETA: 0s - loss: 0.4557 - accuracy: 0.3914
Epoch 00005: val_accuracy did not improve from 0.44196
27/27 [==============================] - 0s 11ms/step - loss: 0.4557 - accuracy: 0.3914 - val_loss: 0.4756 - val_accuracy: 0.4420
Epoch 6/200
27/27 [==============================] - ETA: 0s - loss: 0.4536 - accuracy: 0.3773
Epoch 00006: val_accuracy improved from 0.44196 to 0.44643, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 69ms/step - loss: 0.4536 - accuracy: 0.3773 - val_loss: 0.4763 - val_accuracy: 0.4464
Epoch 7/200
27/27 [==============================] - ETA: 0s - loss: 0.4331 - accuracy: 0.4159
Epoch 00007: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.4331 - accuracy: 0.4159 - val_loss: 0.4748 - val_accuracy: 0.4062
Epoch 8/200
27/27 [==============================] - ETA: 0s - loss: 0.4312 - accuracy: 0.4124
Epoch 00008: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.4312 - accuracy: 0.4124 - val_loss: 0.4773 - val_accuracy: 0.3839
Epoch 9/200
27/27 [==============================] - ETA: 0s - loss: 0.4123 - accuracy: 0.4136
Epoch 00009: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.4123 - accuracy: 0.4136 - val_loss: 0.4691 - val_accuracy: 0.3750
Epoch 10/200
26/27 [===========================>..] - ETA: 0s - loss: 0.4037 - accuracy: 0.4248
Epoch 00010: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.4033 - accuracy: 0.4264 - val_loss: 0.4782 - val_accuracy: 0.3527
Epoch 11/200
27/27 [==============================] - ETA: 0s - loss: 0.3976 - accuracy: 0.4381
Epoch 00011: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3976 - accuracy: 0.4381 - val_loss: 0.4783 - val_accuracy: 0.3214
Epoch 12/200
27/27 [==============================] - ETA: 0s - loss: 0.3874 - accuracy: 0.4708
Epoch 00012: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3874 - accuracy: 0.4708 - val_loss: 0.4717 - val_accuracy: 0.3571
Epoch 13/200
27/27 [==============================] - ETA: 0s - loss: 0.3847 - accuracy: 0.4474
Epoch 00013: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3847 - accuracy: 0.4474 - val_loss: 0.4360 - val_accuracy: 0.4286
Epoch 14/200
27/27 [==============================] - ETA: 0s - loss: 0.3803 - accuracy: 0.4650
Epoch 00014: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3803 - accuracy: 0.4650 - val_loss: 0.4278 - val_accuracy: 0.4062
Epoch 15/200
27/27 [==============================] - ETA: 0s - loss: 0.3675 - accuracy: 0.4743
Epoch 00015: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3675 - accuracy: 0.4743 - val_loss: 0.4135 - val_accuracy: 0.4107
Epoch 16/200
26/27 [===========================>..] - ETA: 0s - loss: 0.3819 - accuracy: 0.4551
Epoch 00016: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3810 - accuracy: 0.4556 - val_loss: 0.4338 - val_accuracy: 0.3929
Epoch 17/200
27/27 [==============================] - ETA: 0s - loss: 0.3767 - accuracy: 0.4685
Epoch 00017: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3767 - accuracy: 0.4685 - val_loss: 0.4482 - val_accuracy: 0.3527
Epoch 18/200
27/27 [==============================] - ETA: 0s - loss: 0.3761 - accuracy: 0.4977
Epoch 00018: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3761 - accuracy: 0.4977 - val_loss: 0.4171 - val_accuracy: 0.3839
Epoch 19/200
27/27 [==============================] - ETA: 0s - loss: 0.3672 - accuracy: 0.4801
Epoch 00019: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3672 - accuracy: 0.4801 - val_loss: 0.4042 - val_accuracy: 0.3795
Epoch 20/200
27/27 [==============================] - ETA: 0s - loss: 0.3563 - accuracy: 0.5327
Epoch 00020: val_accuracy did not improve from 0.44643
27/27 [==============================] - 0s 11ms/step - loss: 0.3563 - accuracy: 0.5327 - val_loss: 0.3861 - val_accuracy: 0.4420
Epoch 21/200
27/27 [==============================] - ETA: 0s - loss: 0.3496 - accuracy: 0.5479
Epoch 00021: val_accuracy improved from 0.44643 to 0.49107, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 72ms/step - loss: 0.3496 - accuracy: 0.5479 - val_loss: 0.3640 - val_accuracy: 0.4911
Epoch 22/200
27/27 [==============================] - ETA: 0s - loss: 0.3508 - accuracy: 0.5619
Epoch 00022: val_accuracy improved from 0.49107 to 0.51786, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 67ms/step - loss: 0.3508 - accuracy: 0.5619 - val_loss: 0.3777 - val_accuracy: 0.5179
Epoch 23/200
27/27 [==============================] - ETA: 0s - loss: 0.3351 - accuracy: 0.5491
Epoch 00023: val_accuracy improved from 0.51786 to 0.54464, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 74ms/step - loss: 0.3351 - accuracy: 0.5491 - val_loss: 0.3509 - val_accuracy: 0.5446
Epoch 24/200
27/27 [==============================] - ETA: 0s - loss: 0.3266 - accuracy: 0.5771
Epoch 00024: val_accuracy improved from 0.54464 to 0.59821, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 73ms/step - loss: 0.3266 - accuracy: 0.5771 - val_loss: 0.3426 - val_accuracy: 0.5982
Epoch 25/200
27/27 [==============================] - ETA: 0s - loss: 0.3391 - accuracy: 0.5572
Epoch 00025: val_accuracy did not improve from 0.59821
27/27 [==============================] - 0s 11ms/step - loss: 0.3391 - accuracy: 0.5572 - val_loss: 0.3471 - val_accuracy: 0.5491
Epoch 26/200
26/27 [===========================>..] - ETA: 0s - loss: 0.3250 - accuracy: 0.5680
Epoch 00026: val_accuracy improved from 0.59821 to 0.63393, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 68ms/step - loss: 0.3246 - accuracy: 0.5678 - val_loss: 0.3259 - val_accuracy: 0.6339
Epoch 27/200
27/27 [==============================] - ETA: 0s - loss: 0.3190 - accuracy: 0.6098
Epoch 00027: val_accuracy did not improve from 0.63393
27/27 [==============================] - 0s 12ms/step - loss: 0.3190 - accuracy: 0.6098 - val_loss: 0.3259 - val_accuracy: 0.5312
Epoch 28/200
26/27 [===========================>..] - ETA: 0s - loss: 0.3226 - accuracy: 0.6034
Epoch 00028: val_accuracy did not improve from 0.63393
27/27 [==============================] - 0s 12ms/step - loss: 0.3220 - accuracy: 0.6040 - val_loss: 0.3260 - val_accuracy: 0.5982
Epoch 29/200
26/27 [===========================>..] - ETA: 0s - loss: 0.3273 - accuracy: 0.5745
Epoch 00029: val_accuracy did not improve from 0.63393
27/27 [==============================] - 0s 12ms/step - loss: 0.3286 - accuracy: 0.5729 - val_loss: 0.3650 - val_accuracy: 0.5179
Epoch 30/200
26/27 [===========================>..] - ETA: 0s - loss: 0.3146 - accuracy: 0.6056
Epoch 00030: val_accuracy improved from 0.63393 to 0.65625, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 75ms/step - loss: 0.3157 - accuracy: 0.6075 - val_loss: 0.3125 - val_accuracy: 0.6562
Epoch 31/200
27/27 [==============================] - ETA: 0s - loss: 0.2958 - accuracy: 0.6285
Epoch 00031: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 11ms/step - loss: 0.2958 - accuracy: 0.6285 - val_loss: 0.3195 - val_accuracy: 0.6071
Epoch 32/200
27/27 [==============================] - ETA: 0s - loss: 0.3226 - accuracy: 0.6110
Epoch 00032: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 11ms/step - loss: 0.3226 - accuracy: 0.6110 - val_loss: 0.3333 - val_accuracy: 0.5848
Epoch 33/200
27/27 [==============================] - ETA: 0s - loss: 0.3026 - accuracy: 0.6227
Epoch 00033: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 11ms/step - loss: 0.3026 - accuracy: 0.6227 - val_loss: 0.3310 - val_accuracy: 0.5848
Epoch 34/200
27/27 [==============================] - ETA: 0s - loss: 0.3039 - accuracy: 0.6285
Epoch 00034: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 11ms/step - loss: 0.3039 - accuracy: 0.6285 - val_loss: 0.3130 - val_accuracy: 0.6161
Epoch 35/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2899 - accuracy: 0.6371
Epoch 00035: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 12ms/step - loss: 0.2897 - accuracy: 0.6379 - val_loss: 0.3009 - val_accuracy: 0.6339
Epoch 36/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2852 - accuracy: 0.6687
Epoch 00036: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 12ms/step - loss: 0.2853 - accuracy: 0.6694 - val_loss: 0.2991 - val_accuracy: 0.6384
Epoch 37/200
27/27 [==============================] - ETA: 0s - loss: 0.2918 - accuracy: 0.6542
Epoch 00037: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 11ms/step - loss: 0.2918 - accuracy: 0.6542 - val_loss: 0.3001 - val_accuracy: 0.6295
Epoch 38/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2815 - accuracy: 0.6687
Epoch 00038: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 12ms/step - loss: 0.2788 - accuracy: 0.6717 - val_loss: 0.2832 - val_accuracy: 0.6473
Epoch 39/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2778 - accuracy: 0.6663
Epoch 00039: val_accuracy did not improve from 0.65625
27/27 [==============================] - 0s 11ms/step - loss: 0.2770 - accuracy: 0.6682 - val_loss: 0.3046 - val_accuracy: 0.6161
Epoch 40/200
27/27 [==============================] - ETA: 0s - loss: 0.2687 - accuracy: 0.7021
Epoch 00040: val_accuracy improved from 0.65625 to 0.67857, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 69ms/step - loss: 0.2687 - accuracy: 0.7021 - val_loss: 0.2926 - val_accuracy: 0.6786
Epoch 41/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2643 - accuracy: 0.7100
Epoch 00041: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 11ms/step - loss: 0.2637 - accuracy: 0.7079 - val_loss: 0.2927 - val_accuracy: 0.6429
Epoch 42/200
27/27 [==============================] - ETA: 0s - loss: 0.2761 - accuracy: 0.6799
Epoch 00042: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 11ms/step - loss: 0.2761 - accuracy: 0.6799 - val_loss: 0.3077 - val_accuracy: 0.6339
Epoch 43/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2624 - accuracy: 0.6784
Epoch 00043: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 12ms/step - loss: 0.2641 - accuracy: 0.6752 - val_loss: 0.3185 - val_accuracy: 0.5670
Epoch 44/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2809 - accuracy: 0.6711
Epoch 00044: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 12ms/step - loss: 0.2800 - accuracy: 0.6729 - val_loss: 0.2977 - val_accuracy: 0.6205
Epoch 45/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2397 - accuracy: 0.7184
Epoch 00045: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 11ms/step - loss: 0.2400 - accuracy: 0.7185 - val_loss: 0.2886 - val_accuracy: 0.6518
Epoch 46/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2559 - accuracy: 0.6954
Epoch 00046: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 12ms/step - loss: 0.2564 - accuracy: 0.6939 - val_loss: 0.2888 - val_accuracy: 0.6562
Epoch 47/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2433 - accuracy: 0.7403
Epoch 00047: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 12ms/step - loss: 0.2447 - accuracy: 0.7348 - val_loss: 0.3158 - val_accuracy: 0.6071
Epoch 48/200
27/27 [==============================] - ETA: 0s - loss: 0.2651 - accuracy: 0.6846
Epoch 00048: val_accuracy did not improve from 0.67857
27/27 [==============================] - 0s 12ms/step - loss: 0.2651 - accuracy: 0.6846 - val_loss: 0.2834 - val_accuracy: 0.6652
Epoch 49/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2441 - accuracy: 0.7391
Epoch 00049: val_accuracy improved from 0.67857 to 0.68750, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 75ms/step - loss: 0.2481 - accuracy: 0.7360 - val_loss: 0.2781 - val_accuracy: 0.6875
Epoch 50/200
23/27 [========================>.....] - ETA: 0s - loss: 0.2590 - accuracy: 0.7060
Epoch 00050: val_accuracy did not improve from 0.68750
27/27 [==============================] - 0s 13ms/step - loss: 0.2522 - accuracy: 0.7161 - val_loss: 0.2875 - val_accuracy: 0.6384
Epoch 51/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2376 - accuracy: 0.7379
Epoch 00051: val_accuracy improved from 0.68750 to 0.69643, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 69ms/step - loss: 0.2366 - accuracy: 0.7407 - val_loss: 0.2688 - val_accuracy: 0.6964
Epoch 52/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2435 - accuracy: 0.7257
Epoch 00052: val_accuracy did not improve from 0.69643
27/27 [==============================] - 0s 12ms/step - loss: 0.2431 - accuracy: 0.7278 - val_loss: 0.3138 - val_accuracy: 0.5938
Epoch 53/200
27/27 [==============================] - ETA: 0s - loss: 0.2425 - accuracy: 0.7044
Epoch 00053: val_accuracy did not improve from 0.69643
27/27 [==============================] - 0s 11ms/step - loss: 0.2425 - accuracy: 0.7044 - val_loss: 0.2941 - val_accuracy: 0.6205
Epoch 54/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2473 - accuracy: 0.7100
Epoch 00054: val_accuracy did not improve from 0.69643
27/27 [==============================] - 0s 11ms/step - loss: 0.2476 - accuracy: 0.7103 - val_loss: 0.2767 - val_accuracy: 0.6741
Epoch 55/200
27/27 [==============================] - ETA: 0s - loss: 0.2271 - accuracy: 0.7512
Epoch 00055: val_accuracy did not improve from 0.69643
27/27 [==============================] - 0s 11ms/step - loss: 0.2271 - accuracy: 0.7512 - val_loss: 0.2699 - val_accuracy: 0.6741
Epoch 56/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2299 - accuracy: 0.7320
Epoch 00056: val_accuracy did not improve from 0.69643
27/27 [==============================] - 0s 11ms/step - loss: 0.2272 - accuracy: 0.7360 - val_loss: 0.2570 - val_accuracy: 0.6920
Epoch 57/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2376 - accuracy: 0.7260
Epoch 00057: val_accuracy improved from 0.69643 to 0.70089, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 74ms/step - loss: 0.2399 - accuracy: 0.7245 - val_loss: 0.2627 - val_accuracy: 0.7009
Epoch 58/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2243 - accuracy: 0.7294
Epoch 00058: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2226 - accuracy: 0.7336 - val_loss: 0.2783 - val_accuracy: 0.6696
Epoch 59/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2180 - accuracy: 0.7488
Epoch 00059: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2197 - accuracy: 0.7465 - val_loss: 0.2571 - val_accuracy: 0.6920
Epoch 60/200
27/27 [==============================] - ETA: 0s - loss: 0.2078 - accuracy: 0.7710
Epoch 00060: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 11ms/step - loss: 0.2078 - accuracy: 0.7710 - val_loss: 0.2707 - val_accuracy: 0.6920
Epoch 61/200
27/27 [==============================] - ETA: 0s - loss: 0.2173 - accuracy: 0.7745
Epoch 00061: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2173 - accuracy: 0.7745 - val_loss: 0.2713 - val_accuracy: 0.6741
Epoch 62/200
27/27 [==============================] - ETA: 0s - loss: 0.1944 - accuracy: 0.7886
Epoch 00062: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.1944 - accuracy: 0.7886 - val_loss: 0.2824 - val_accuracy: 0.6741
Epoch 63/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2064 - accuracy: 0.7670
Epoch 00063: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2047 - accuracy: 0.7699 - val_loss: 0.2678 - val_accuracy: 0.6696
Epoch 64/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2221 - accuracy: 0.7573
Epoch 00064: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2218 - accuracy: 0.7570 - val_loss: 0.2920 - val_accuracy: 0.6607
Epoch 65/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2175 - accuracy: 0.7597
Epoch 00065: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2172 - accuracy: 0.7605 - val_loss: 0.2464 - val_accuracy: 0.6964
Epoch 66/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2147 - accuracy: 0.7464
Epoch 00066: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 12ms/step - loss: 0.2146 - accuracy: 0.7477 - val_loss: 0.2506 - val_accuracy: 0.6786
Epoch 67/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2320 - accuracy: 0.7549
Epoch 00067: val_accuracy did not improve from 0.70089
27/27 [==============================] - 0s 11ms/step - loss: 0.2316 - accuracy: 0.7535 - val_loss: 0.2710 - val_accuracy: 0.6875
Epoch 68/200
26/27 [===========================>..] - ETA: 0s - loss: 0.2085 - accuracy: 0.7585
Epoch 00068: val_accuracy improved from 0.70089 to 0.70982, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 69ms/step - loss: 0.2076 - accuracy: 0.7582 - val_loss: 0.2472 - val_accuracy: 0.7098
Epoch 69/200
27/27 [==============================] - ETA: 0s - loss: 0.1815 - accuracy: 0.8084
Epoch 00069: val_accuracy improved from 0.70982 to 0.77232, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 74ms/step - loss: 0.1815 - accuracy: 0.8084 - val_loss: 0.2054 - val_accuracy: 0.7723
Epoch 70/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1744 - accuracy: 0.8265
Epoch 00070: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 12ms/step - loss: 0.1755 - accuracy: 0.8248 - val_loss: 0.2418 - val_accuracy: 0.7232
Epoch 71/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1851 - accuracy: 0.7973
Epoch 00071: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 12ms/step - loss: 0.1873 - accuracy: 0.7956 - val_loss: 0.2362 - val_accuracy: 0.7009
Epoch 72/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1928 - accuracy: 0.8010
Epoch 00072: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 12ms/step - loss: 0.1918 - accuracy: 0.8002 - val_loss: 0.2299 - val_accuracy: 0.7500
Epoch 73/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1800 - accuracy: 0.8022
Epoch 00073: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 12ms/step - loss: 0.1801 - accuracy: 0.8049 - val_loss: 0.2403 - val_accuracy: 0.7589
Epoch 74/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1663 - accuracy: 0.8301
Epoch 00074: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 12ms/step - loss: 0.1677 - accuracy: 0.8271 - val_loss: 0.2128 - val_accuracy: 0.7545
Epoch 75/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1883 - accuracy: 0.8034
Epoch 00075: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 11ms/step - loss: 0.1859 - accuracy: 0.8061 - val_loss: 0.2279 - val_accuracy: 0.7321
Epoch 76/200
27/27 [==============================] - ETA: 0s - loss: 0.1928 - accuracy: 0.7967
Epoch 00076: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 11ms/step - loss: 0.1928 - accuracy: 0.7967 - val_loss: 0.2729 - val_accuracy: 0.6741
Epoch 77/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1666 - accuracy: 0.8350
Epoch 00077: val_accuracy did not improve from 0.77232
27/27 [==============================] - 0s 11ms/step - loss: 0.1678 - accuracy: 0.8341 - val_loss: 0.2371 - val_accuracy: 0.7098
Epoch 78/200
27/27 [==============================] - ETA: 0s - loss: 0.1709 - accuracy: 0.8283
Epoch 00078: val_accuracy improved from 0.77232 to 0.77679, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 68ms/step - loss: 0.1709 - accuracy: 0.8283 - val_loss: 0.2242 - val_accuracy: 0.7768
Epoch 79/200
27/27 [==============================] - ETA: 0s - loss: 0.1756 - accuracy: 0.8131
Epoch 00079: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1756 - accuracy: 0.8131 - val_loss: 0.2027 - val_accuracy: 0.7768
Epoch 80/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1665 - accuracy: 0.8337
Epoch 00080: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1661 - accuracy: 0.8329 - val_loss: 0.2406 - val_accuracy: 0.7411
Epoch 81/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1751 - accuracy: 0.8228
Epoch 00081: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1756 - accuracy: 0.8236 - val_loss: 0.2170 - val_accuracy: 0.7321
Epoch 82/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1633 - accuracy: 0.8119
Epoch 00082: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1648 - accuracy: 0.8096 - val_loss: 0.2094 - val_accuracy: 0.7589
Epoch 83/200
27/27 [==============================] - ETA: 0s - loss: 0.1637 - accuracy: 0.8400
Epoch 00083: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1637 - accuracy: 0.8400 - val_loss: 0.1991 - val_accuracy: 0.7589
Epoch 84/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1705 - accuracy: 0.8209
Epoch 00084: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1743 - accuracy: 0.8178 - val_loss: 0.2239 - val_accuracy: 0.7545
Epoch 85/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1676 - accuracy: 0.8293
Epoch 00085: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1689 - accuracy: 0.8264 - val_loss: 0.2246 - val_accuracy: 0.7500
Epoch 86/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1687 - accuracy: 0.8228
Epoch 00086: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1672 - accuracy: 0.8236 - val_loss: 0.2240 - val_accuracy: 0.7232
Epoch 87/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1542 - accuracy: 0.8386
Epoch 00087: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1555 - accuracy: 0.8364 - val_loss: 0.2187 - val_accuracy: 0.7455
Epoch 88/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1519 - accuracy: 0.8532
Epoch 00088: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1511 - accuracy: 0.8516 - val_loss: 0.1956 - val_accuracy: 0.7768
Epoch 89/200
27/27 [==============================] - ETA: 0s - loss: 0.1565 - accuracy: 0.8481
Epoch 00089: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1565 - accuracy: 0.8481 - val_loss: 0.2136 - val_accuracy: 0.7232
Epoch 90/200
27/27 [==============================] - ETA: 0s - loss: 0.1656 - accuracy: 0.8341
Epoch 00090: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1656 - accuracy: 0.8341 - val_loss: 0.2303 - val_accuracy: 0.7321
Epoch 91/200
27/27 [==============================] - ETA: 0s - loss: 0.1618 - accuracy: 0.8400
Epoch 00091: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 11ms/step - loss: 0.1618 - accuracy: 0.8400 - val_loss: 0.2093 - val_accuracy: 0.7634
Epoch 92/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1594 - accuracy: 0.8447
Epoch 00092: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1590 - accuracy: 0.8458 - val_loss: 0.2245 - val_accuracy: 0.7545
Epoch 93/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1679 - accuracy: 0.8459
Epoch 00093: val_accuracy did not improve from 0.77679
27/27 [==============================] - 0s 12ms/step - loss: 0.1666 - accuracy: 0.8446 - val_loss: 0.2193 - val_accuracy: 0.7455
Epoch 94/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1511 - accuracy: 0.8374
Epoch 00094: val_accuracy improved from 0.77679 to 0.79464, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 76ms/step - loss: 0.1517 - accuracy: 0.8376 - val_loss: 0.1918 - val_accuracy: 0.7946
Epoch 95/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1593 - accuracy: 0.8374
Epoch 00095: val_accuracy did not improve from 0.79464
27/27 [==============================] - 0s 12ms/step - loss: 0.1570 - accuracy: 0.8411 - val_loss: 0.2013 - val_accuracy: 0.7723
Epoch 96/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1633 - accuracy: 0.8301
Epoch 00096: val_accuracy did not improve from 0.79464
27/27 [==============================] - 0s 12ms/step - loss: 0.1616 - accuracy: 0.8318 - val_loss: 0.1878 - val_accuracy: 0.7768
Epoch 97/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1359 - accuracy: 0.8641
Epoch 00097: val_accuracy improved from 0.79464 to 0.80804, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 69ms/step - loss: 0.1354 - accuracy: 0.8621 - val_loss: 0.1885 - val_accuracy: 0.8080
Epoch 98/200
27/27 [==============================] - ETA: 0s - loss: 0.1489 - accuracy: 0.8458
Epoch 00098: val_accuracy did not improve from 0.80804
27/27 [==============================] - 0s 11ms/step - loss: 0.1489 - accuracy: 0.8458 - val_loss: 0.1779 - val_accuracy: 0.7857
Epoch 99/200
27/27 [==============================] - ETA: 0s - loss: 0.1350 - accuracy: 0.8657
Epoch 00099: val_accuracy did not improve from 0.80804
27/27 [==============================] - 0s 11ms/step - loss: 0.1350 - accuracy: 0.8657 - val_loss: 0.1902 - val_accuracy: 0.8036
Epoch 100/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1302 - accuracy: 0.8604
Epoch 00100: val_accuracy did not improve from 0.80804
27/27 [==============================] - 0s 12ms/step - loss: 0.1306 - accuracy: 0.8598 - val_loss: 0.2228 - val_accuracy: 0.7545
Epoch 101/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1420 - accuracy: 0.8665
Epoch 00101: val_accuracy did not improve from 0.80804
27/27 [==============================] - 0s 12ms/step - loss: 0.1412 - accuracy: 0.8668 - val_loss: 0.2088 - val_accuracy: 0.7723
Epoch 102/200
27/27 [==============================] - ETA: 0s - loss: 0.1447 - accuracy: 0.8540
Epoch 00102: val_accuracy improved from 0.80804 to 0.81696, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 74ms/step - loss: 0.1447 - accuracy: 0.8540 - val_loss: 0.1856 - val_accuracy: 0.8170
Epoch 103/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1458 - accuracy: 0.8447
Epoch 00103: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1448 - accuracy: 0.8470 - val_loss: 0.1842 - val_accuracy: 0.7634
Epoch 104/200
27/27 [==============================] - ETA: 0s - loss: 0.1294 - accuracy: 0.8668
Epoch 00104: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1294 - accuracy: 0.8668 - val_loss: 0.2585 - val_accuracy: 0.7455
Epoch 105/200
27/27 [==============================] - ETA: 0s - loss: 0.1445 - accuracy: 0.8493
Epoch 00105: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1445 - accuracy: 0.8493 - val_loss: 0.2191 - val_accuracy: 0.7679
Epoch 106/200
27/27 [==============================] - ETA: 0s - loss: 0.1364 - accuracy: 0.8551
Epoch 00106: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1364 - accuracy: 0.8551 - val_loss: 0.1925 - val_accuracy: 0.7768
Epoch 107/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1139 - accuracy: 0.8847
Epoch 00107: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1128 - accuracy: 0.8867 - val_loss: 0.2425 - val_accuracy: 0.7143
Epoch 108/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1292 - accuracy: 0.8714
Epoch 00108: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1323 - accuracy: 0.8703 - val_loss: 0.2394 - val_accuracy: 0.7411
Epoch 109/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1579 - accuracy: 0.8447
Epoch 00109: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1558 - accuracy: 0.8458 - val_loss: 0.1976 - val_accuracy: 0.7812
Epoch 110/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1295 - accuracy: 0.8629
Epoch 00110: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1309 - accuracy: 0.8610 - val_loss: 0.1881 - val_accuracy: 0.7723
Epoch 111/200
27/27 [==============================] - ETA: 0s - loss: 0.1352 - accuracy: 0.8715
Epoch 00111: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1352 - accuracy: 0.8715 - val_loss: 0.2030 - val_accuracy: 0.7679
Epoch 112/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1248 - accuracy: 0.8618
Epoch 00112: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1241 - accuracy: 0.8621 - val_loss: 0.1979 - val_accuracy: 0.7634
Epoch 113/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1171 - accuracy: 0.8726
Epoch 00113: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1176 - accuracy: 0.8738 - val_loss: 0.1874 - val_accuracy: 0.7857
Epoch 114/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1208 - accuracy: 0.8774
Epoch 00114: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1231 - accuracy: 0.8750 - val_loss: 0.2099 - val_accuracy: 0.7679
Epoch 115/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1051 - accuracy: 0.9041
Epoch 00115: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1069 - accuracy: 0.9030 - val_loss: 0.1997 - val_accuracy: 0.7857
Epoch 116/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1540 - accuracy: 0.8422
Epoch 00116: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1546 - accuracy: 0.8435 - val_loss: 0.2555 - val_accuracy: 0.7143
Epoch 117/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1326 - accuracy: 0.8774
Epoch 00117: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1363 - accuracy: 0.8762 - val_loss: 0.2308 - val_accuracy: 0.7188
Epoch 118/200
27/27 [==============================] - ETA: 0s - loss: 0.1301 - accuracy: 0.8773
Epoch 00118: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1301 - accuracy: 0.8773 - val_loss: 0.2178 - val_accuracy: 0.7366
Epoch 119/200
27/27 [==============================] - ETA: 0s - loss: 0.1187 - accuracy: 0.8902
Epoch 00119: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 11ms/step - loss: 0.1187 - accuracy: 0.8902 - val_loss: 0.1988 - val_accuracy: 0.7857
Epoch 120/200
27/27 [==============================] - ETA: 0s - loss: 0.1288 - accuracy: 0.8703
Epoch 00120: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1288 - accuracy: 0.8703 - val_loss: 0.2417 - val_accuracy: 0.7321
Epoch 121/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1189 - accuracy: 0.8859
Epoch 00121: val_accuracy did not improve from 0.81696
27/27 [==============================] - 0s 12ms/step - loss: 0.1202 - accuracy: 0.8843 - val_loss: 0.2004 - val_accuracy: 0.7902
Epoch 122/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1106 - accuracy: 0.8956
Epoch 00122: val_accuracy improved from 0.81696 to 0.82143, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 68ms/step - loss: 0.1107 - accuracy: 0.8949 - val_loss: 0.1927 - val_accuracy: 0.8214
Epoch 123/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1185 - accuracy: 0.9017
Epoch 00123: val_accuracy improved from 0.82143 to 0.82589, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 75ms/step - loss: 0.1222 - accuracy: 0.9007 - val_loss: 0.1777 - val_accuracy: 0.8259
Epoch 124/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1319 - accuracy: 0.8677
Epoch 00124: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 12ms/step - loss: 0.1304 - accuracy: 0.8703 - val_loss: 0.2084 - val_accuracy: 0.7679
Epoch 125/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1271 - accuracy: 0.8689
Epoch 00125: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 12ms/step - loss: 0.1249 - accuracy: 0.8727 - val_loss: 0.1882 - val_accuracy: 0.7991
Epoch 126/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1271 - accuracy: 0.8750
Epoch 00126: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 12ms/step - loss: 0.1270 - accuracy: 0.8750 - val_loss: 0.1830 - val_accuracy: 0.7946
Epoch 127/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1003 - accuracy: 0.9005
Epoch 00127: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 11ms/step - loss: 0.1027 - accuracy: 0.8995 - val_loss: 0.1941 - val_accuracy: 0.7634
Epoch 128/200
27/27 [==============================] - ETA: 0s - loss: 0.1110 - accuracy: 0.8949
Epoch 00128: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 11ms/step - loss: 0.1110 - accuracy: 0.8949 - val_loss: 0.2230 - val_accuracy: 0.7500
Epoch 129/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1190 - accuracy: 0.8859
Epoch 00129: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 12ms/step - loss: 0.1178 - accuracy: 0.8890 - val_loss: 0.1798 - val_accuracy: 0.8080
Epoch 130/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1040 - accuracy: 0.9041
Epoch 00130: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 12ms/step - loss: 0.1032 - accuracy: 0.9030 - val_loss: 0.1777 - val_accuracy: 0.8125
Epoch 131/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1102 - accuracy: 0.8993
Epoch 00131: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 12ms/step - loss: 0.1108 - accuracy: 0.8984 - val_loss: 0.2053 - val_accuracy: 0.7946
Epoch 132/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1254 - accuracy: 0.8786
Epoch 00132: val_accuracy did not improve from 0.82589
27/27 [==============================] - 0s 11ms/step - loss: 0.1240 - accuracy: 0.8797 - val_loss: 0.1816 - val_accuracy: 0.7902
Epoch 133/200
27/27 [==============================] - ETA: 0s - loss: 0.0967 - accuracy: 0.8925
Epoch 00133: val_accuracy improved from 0.82589 to 0.83036, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 73ms/step - loss: 0.0967 - accuracy: 0.8925 - val_loss: 0.1869 - val_accuracy: 0.8304
Epoch 134/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1104 - accuracy: 0.9005
Epoch 00134: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1083 - accuracy: 0.9007 - val_loss: 0.2008 - val_accuracy: 0.7946
Epoch 135/200
27/27 [==============================] - ETA: 0s - loss: 0.1082 - accuracy: 0.8972
Epoch 00135: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.1082 - accuracy: 0.8972 - val_loss: 0.2334 - val_accuracy: 0.7500
Epoch 136/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1234 - accuracy: 0.8896
Epoch 00136: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1227 - accuracy: 0.8890 - val_loss: 0.1844 - val_accuracy: 0.8036
Epoch 137/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1194 - accuracy: 0.8774
Epoch 00137: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1190 - accuracy: 0.8797 - val_loss: 0.1907 - val_accuracy: 0.7768
Epoch 138/200
27/27 [==============================] - ETA: 0s - loss: 0.0999 - accuracy: 0.9112
Epoch 00138: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.0999 - accuracy: 0.9112 - val_loss: 0.1825 - val_accuracy: 0.8214
Epoch 139/200
27/27 [==============================] - ETA: 0s - loss: 0.1001 - accuracy: 0.9065
Epoch 00139: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.1001 - accuracy: 0.9065 - val_loss: 0.1628 - val_accuracy: 0.8170
Epoch 140/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0985 - accuracy: 0.9026
Epoch 00140: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.0984 - accuracy: 0.9019 - val_loss: 0.1944 - val_accuracy: 0.7812
Epoch 141/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0912 - accuracy: 0.9111
Epoch 00141: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.0906 - accuracy: 0.9132 - val_loss: 0.2438 - val_accuracy: 0.7500
Epoch 142/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1077 - accuracy: 0.9017
Epoch 00142: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1086 - accuracy: 0.8995 - val_loss: 0.3024 - val_accuracy: 0.7679
Epoch 143/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1131 - accuracy: 0.9017
Epoch 00143: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1170 - accuracy: 0.8972 - val_loss: 0.2342 - val_accuracy: 0.7812
Epoch 144/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1044 - accuracy: 0.9017
Epoch 00144: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1028 - accuracy: 0.9030 - val_loss: 0.2661 - val_accuracy: 0.7321
Epoch 145/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1064 - accuracy: 0.9053
Epoch 00145: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1055 - accuracy: 0.9042 - val_loss: 0.2020 - val_accuracy: 0.7902
Epoch 146/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1011 - accuracy: 0.8908
Epoch 00146: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.0994 - accuracy: 0.8925 - val_loss: 0.2063 - val_accuracy: 0.7946
Epoch 147/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0962 - accuracy: 0.9029
Epoch 00147: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.0953 - accuracy: 0.9042 - val_loss: 0.1758 - val_accuracy: 0.8170
Epoch 148/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0967 - accuracy: 0.9114
Epoch 00148: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.0961 - accuracy: 0.9089 - val_loss: 0.2735 - val_accuracy: 0.7634
Epoch 149/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1028 - accuracy: 0.8981
Epoch 00149: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1012 - accuracy: 0.8995 - val_loss: 0.2457 - val_accuracy: 0.7232
Epoch 150/200
27/27 [==============================] - ETA: 0s - loss: 0.1131 - accuracy: 0.8960
Epoch 00150: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.1131 - accuracy: 0.8960 - val_loss: 0.2110 - val_accuracy: 0.8170
Epoch 151/200
27/27 [==============================] - ETA: 0s - loss: 0.0762 - accuracy: 0.9311
Epoch 00151: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.0762 - accuracy: 0.9311 - val_loss: 0.2608 - val_accuracy: 0.7946
Epoch 152/200
27/27 [==============================] - ETA: 0s - loss: 0.1047 - accuracy: 0.8995
Epoch 00152: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.1047 - accuracy: 0.8995 - val_loss: 0.2140 - val_accuracy: 0.7634
Epoch 153/200
27/27 [==============================] - ETA: 0s - loss: 0.1079 - accuracy: 0.9019
Epoch 00153: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.1079 - accuracy: 0.9019 - val_loss: 0.1911 - val_accuracy: 0.8214
Epoch 154/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1091 - accuracy: 0.8896
Epoch 00154: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1066 - accuracy: 0.8937 - val_loss: 0.2169 - val_accuracy: 0.7946
Epoch 155/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1060 - accuracy: 0.8968
Epoch 00155: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1068 - accuracy: 0.8972 - val_loss: 0.2408 - val_accuracy: 0.7411
Epoch 156/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1102 - accuracy: 0.8993
Epoch 00156: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 12ms/step - loss: 0.1070 - accuracy: 0.9030 - val_loss: 0.2313 - val_accuracy: 0.7679
Epoch 157/200
27/27 [==============================] - ETA: 0s - loss: 0.1107 - accuracy: 0.8984
Epoch 00157: val_accuracy did not improve from 0.83036
27/27 [==============================] - 0s 11ms/step - loss: 0.1107 - accuracy: 0.8984 - val_loss: 0.1683 - val_accuracy: 0.8304
Epoch 158/200
27/27 [==============================] - ETA: 0s - loss: 0.0771 - accuracy: 0.9217
Epoch 00158: val_accuracy improved from 0.83036 to 0.84375, saving model to ./base.model
INFO:tensorflow:Assets written to: ./base.model/assets
27/27 [==============================] - 2s 68ms/step - loss: 0.0771 - accuracy: 0.9217 - val_loss: 0.1853 - val_accuracy: 0.8438
Epoch 159/200
27/27 [==============================] - ETA: 0s - loss: 0.1010 - accuracy: 0.8995
Epoch 00159: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.1010 - accuracy: 0.8995 - val_loss: 0.2199 - val_accuracy: 0.7723
Epoch 160/200
27/27 [==============================] - ETA: 0s - loss: 0.0765 - accuracy: 0.9287
Epoch 00160: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0765 - accuracy: 0.9287 - val_loss: 0.2006 - val_accuracy: 0.8259
Epoch 161/200
27/27 [==============================] - ETA: 0s - loss: 0.0876 - accuracy: 0.9147
Epoch 00161: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0876 - accuracy: 0.9147 - val_loss: 0.1880 - val_accuracy: 0.7857
Epoch 162/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0738 - accuracy: 0.9381
Epoch 00162: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0741 - accuracy: 0.9381 - val_loss: 0.1936 - val_accuracy: 0.8214
Epoch 163/200
27/27 [==============================] - ETA: 0s - loss: 0.1015 - accuracy: 0.9089
Epoch 00163: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.1015 - accuracy: 0.9089 - val_loss: 0.2289 - val_accuracy: 0.8170
Epoch 164/200
27/27 [==============================] - ETA: 0s - loss: 0.0869 - accuracy: 0.9136
Epoch 00164: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0869 - accuracy: 0.9136 - val_loss: 0.1723 - val_accuracy: 0.8125
Epoch 165/200
27/27 [==============================] - ETA: 0s - loss: 0.0815 - accuracy: 0.9252
Epoch 00165: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0815 - accuracy: 0.9252 - val_loss: 0.1882 - val_accuracy: 0.8125
Epoch 166/200
27/27 [==============================] - ETA: 0s - loss: 0.1055 - accuracy: 0.9089
Epoch 00166: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.1055 - accuracy: 0.9089 - val_loss: 0.1649 - val_accuracy: 0.8170
Epoch 167/200
27/27 [==============================] - ETA: 0s - loss: 0.0971 - accuracy: 0.9019
Epoch 00167: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0971 - accuracy: 0.9019 - val_loss: 0.2217 - val_accuracy: 0.7723
Epoch 168/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0810 - accuracy: 0.9231
Epoch 00168: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0802 - accuracy: 0.9229 - val_loss: 0.1827 - val_accuracy: 0.8125
Epoch 169/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0802 - accuracy: 0.9147
Epoch 00169: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0816 - accuracy: 0.9132 - val_loss: 0.2284 - val_accuracy: 0.7768
Epoch 170/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0942 - accuracy: 0.9284
Epoch 00170: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0919 - accuracy: 0.9299 - val_loss: 0.2380 - val_accuracy: 0.7723
Epoch 171/200
27/27 [==============================] - ETA: 0s - loss: 0.0878 - accuracy: 0.9241
Epoch 00171: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0878 - accuracy: 0.9241 - val_loss: 0.1626 - val_accuracy: 0.8304
Epoch 172/200
27/27 [==============================] - ETA: 0s - loss: 0.0925 - accuracy: 0.9241
Epoch 00172: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0925 - accuracy: 0.9241 - val_loss: 0.1801 - val_accuracy: 0.8125
Epoch 173/200
27/27 [==============================] - ETA: 0s - loss: 0.0983 - accuracy: 0.9054
Epoch 00173: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0983 - accuracy: 0.9054 - val_loss: 0.2186 - val_accuracy: 0.8080
Epoch 174/200
27/27 [==============================] - ETA: 0s - loss: 0.0876 - accuracy: 0.9206
Epoch 00174: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0876 - accuracy: 0.9206 - val_loss: 0.2104 - val_accuracy: 0.7857
Epoch 175/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0744 - accuracy: 0.9345
Epoch 00175: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0736 - accuracy: 0.9357 - val_loss: 0.1887 - val_accuracy: 0.7991
Epoch 176/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0705 - accuracy: 0.9333
Epoch 00176: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0695 - accuracy: 0.9346 - val_loss: 0.2126 - val_accuracy: 0.7812
Epoch 177/200
27/27 [==============================] - ETA: 0s - loss: 0.0798 - accuracy: 0.9241
Epoch 00177: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0798 - accuracy: 0.9241 - val_loss: 0.2082 - val_accuracy: 0.8036
Epoch 178/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1045 - accuracy: 0.9114
Epoch 00178: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.1033 - accuracy: 0.9124 - val_loss: 0.2099 - val_accuracy: 0.8036
Epoch 179/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0938 - accuracy: 0.9053
Epoch 00179: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0923 - accuracy: 0.9077 - val_loss: 0.2159 - val_accuracy: 0.7723
Epoch 180/200
26/27 [===========================>..] - ETA: 0s - loss: 0.1057 - accuracy: 0.8981
Epoch 00180: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.1057 - accuracy: 0.8984 - val_loss: 0.1918 - val_accuracy: 0.8080
Epoch 181/200
26/27 [===========================>..] - ETA: 0s - loss: 0.0807 - accuracy: 0.9163
Epoch 00181: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0796 - accuracy: 0.9171 - val_loss: 0.2125 - val_accuracy: 0.7902
Epoch 182/200
27/27 [==============================] - ETA: 0s - loss: 0.0673 - accuracy: 0.9311
Epoch 00182: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 12ms/step - loss: 0.0673 - accuracy: 0.9311 - val_loss: 0.1971 - val_accuracy: 0.8170
Epoch 183/200
27/27 [==============================] - ETA: 0s - loss: 0.0812 - accuracy: 0.9264
Epoch 00183: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0812 - accuracy: 0.9264 - val_loss: 0.2103 - val_accuracy: 0.7857
Epoch 184/200
27/27 [==============================] - ETA: 0s - loss: 0.0988 - accuracy: 0.9100
Epoch 00184: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0988 - accuracy: 0.9100 - val_loss: 0.2207 - val_accuracy: 0.7857
Epoch 185/200
27/27 [==============================] - ETA: 0s - loss: 0.0788 - accuracy: 0.9322
Epoch 00185: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0788 - accuracy: 0.9322 - val_loss: 0.2239 - val_accuracy: 0.7634
Epoch 186/200
27/27 [==============================] - ETA: 0s - loss: 0.0702 - accuracy: 0.9416
Epoch 00186: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0702 - accuracy: 0.9416 - val_loss: 0.1812 - val_accuracy: 0.8348
Epoch 187/200
27/27 [==============================] - ETA: 0s - loss: 0.0796 - accuracy: 0.9229
Epoch 00187: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0796 - accuracy: 0.9229 - val_loss: 0.1836 - val_accuracy: 0.8393
Epoch 188/200
27/27 [==============================] - ETA: 0s - loss: 0.0822 - accuracy: 0.9229
Epoch 00188: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0822 - accuracy: 0.9229 - val_loss: 0.1845 - val_accuracy: 0.8259
Epoch 189/200
27/27 [==============================] - ETA: 0s - loss: 0.0843 - accuracy: 0.9311
Epoch 00189: val_accuracy did not improve from 0.84375
27/27 [==============================] - 0s 11ms/step - loss: 0.0843 - accuracy: 0.9311 - val_loss: 0.2338 - val_accuracy: 0.7679
Epoch 00189: early stopping

Loss/Accuracy vs Epoch

In [19]:
show_final_history(history)
model.save("model.h5")
print("Weights Saved")
Weights Saved

Making predictions on the test images

In [20]:
test_pred = model.predict(test_images)
test_pred = np.argmax(test_pred,axis=1)
test_actual = np.argmax(test_labels,axis=1)

rnd_idx = random.sample(range(0,100),5)

class_labels = {i:class_name for (class_name,i) in class_name_labels.items()}

for i,idx in enumerate(rnd_idx):
    plt.imshow(test_images[idx])
    plt.title("Actual: {}\nPredicted: {}".format(class_labels[test_actual[idx]],class_labels[test_pred[idx]]))
    plt.grid(None)
    plt.show()
    pass