DS-CNN/KWS inference

This tutorial illustrates how to build a basic speech recognition Akida network that recognizes ten different words.

The model will be first defined as a CNN and trained in Keras, then converted using the CNN2SNN toolkit.

This example uses a Keyword Spotting Dataset prepared using TensorFlow audio recognition example utils.

The words to recognize are first converted to spectrogram images that allows us to use a model architecture that is typically used for image recognition tasks.

1. Load CNN2SNN tool dependencies

# System imports
import os
import sys
import numpy as np
import pickle
from sklearn.metrics import accuracy_score
import itertools
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt

# TensorFlow imports
import tensorflow.keras.backend as K
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.utils import get_file

# KWS model imports
from akida_models import ds_cnn_kws_pretrained

2. Load the preprocessed dataset

wanted_words = [
    'down', 'go', 'left', 'no', 'off', 'on', 'right', 'stop', 'up', 'yes'
]
all_words = ['_silence_', '_unknown_'] + wanted_words

# Preprocessed dataset parameters
CHANNELS = 1
CLASSES = len(all_words)
SPECTROGRAM_LENGTH = 49
FINGERPRINT_WIDTH = 10

input_shape = (SPECTROGRAM_LENGTH, FINGERPRINT_WIDTH, CHANNELS)

# Try to load pre-processed dataset
fname = get_file(
    "preprocessed_data.pkl",
    "http://data.brainchip.com/dataset-mirror/kws/preprocessed_data.pkl",
    cache_subdir='datasets/kws')
if os.path.isfile(fname):
    print('Re-loading previously preprocessed dataset...')
    f = open(fname, 'rb')
    [x_train, y_train, x_valid, y_valid, train_files, val_files,
     word_to_index] = pickle.load(f)
    f.close()
else:
    raise ValueError("Unable to load the pre-processed KWS dataset.")

# Transform the data to uint8
x_train_min = x_train.min()
x_train_max = x_train.max()
max_int_value = 255.0

# For akida hardware training and validation range [0, 255] inclusive uint8
x_train_akida = ((x_train - x_train_min) * max_int_value /
                 (x_train_max - x_train_min)).astype(np.uint8)
x_valid_akida = ((x_valid - x_train_min) * max_int_value /
                 (x_train_max - x_train_min)).astype(np.uint8)

# For cnn2snn training and validation range [0,1] inclusive float32
x_train_rescaled_cnn = (x_train_akida.astype(np.float32)) / max_int_value
x_valid_rescaled_cnn = (x_valid_akida.astype(np.float32)) / max_int_value

input_scaling = (max_int_value, 0)

Out:

Downloading data from http://data.brainchip.com/dataset-mirror/kws/preprocessed_data.pkl

     8192/175810841 [..............................] - ETA: 6:37
    73728/175810841 [..............................] - ETA: 3:00
   270336/175810841 [..............................] - ETA: 1:27
   466944/175810841 [..............................] - ETA: 1:12
   663552/175810841 [..............................] - ETA: 1:06
   860160/175810841 [..............................] - ETA: 1:03
  1056768/175810841 [..............................] - ETA: 1:01
  1253376/175810841 [..............................] - ETA: 1:00
  1449984/175810841 [..............................] - ETA: 58s 
  1646592/175810841 [..............................] - ETA: 58s
  1843200/175810841 [..............................] - ETA: 57s
  2039808/175810841 [..............................] - ETA: 56s
  2236416/175810841 [..............................] - ETA: 56s
  2433024/175810841 [..............................] - ETA: 56s
  2629632/175810841 [..............................] - ETA: 55s
  2826240/175810841 [..............................] - ETA: 55s
  3022848/175810841 [..............................] - ETA: 55s
  3219456/175810841 [..............................] - ETA: 54s
  3416064/175810841 [..............................] - ETA: 54s
  3612672/175810841 [..............................] - ETA: 54s
  3809280/175810841 [..............................] - ETA: 54s
  4005888/175810841 [..............................] - ETA: 54s
  4202496/175810841 [..............................] - ETA: 53s
  4399104/175810841 [..............................] - ETA: 53s
  4595712/175810841 [..............................] - ETA: 53s
  4792320/175810841 [..............................] - ETA: 53s
  4988928/175810841 [..............................] - ETA: 53s
  5185536/175810841 [..............................] - ETA: 53s
  5382144/175810841 [..............................] - ETA: 53s
  5578752/175810841 [..............................] - ETA: 52s
  5775360/175810841 [..............................] - ETA: 52s
  5971968/175810841 [>.............................] - ETA: 52s
  6168576/175810841 [>.............................] - ETA: 52s
  6365184/175810841 [>.............................] - ETA: 52s
  6561792/175810841 [>.............................] - ETA: 52s
  6758400/175810841 [>.............................] - ETA: 52s
  6955008/175810841 [>.............................] - ETA: 52s
  7151616/175810841 [>.............................] - ETA: 52s
  7348224/175810841 [>.............................] - ETA: 51s
  7544832/175810841 [>.............................] - ETA: 51s
  7741440/175810841 [>.............................] - ETA: 51s
  7938048/175810841 [>.............................] - ETA: 51s
  8134656/175810841 [>.............................] - ETA: 51s
  8331264/175810841 [>.............................] - ETA: 51s
  8527872/175810841 [>.............................] - ETA: 51s
  8724480/175810841 [>.............................] - ETA: 51s
  8921088/175810841 [>.............................] - ETA: 51s
  9117696/175810841 [>.............................] - ETA: 51s
  9314304/175810841 [>.............................] - ETA: 51s
  9510912/175810841 [>.............................] - ETA: 51s
  9707520/175810841 [>.............................] - ETA: 50s
  9904128/175810841 [>.............................] - ETA: 50s
 10100736/175810841 [>.............................] - ETA: 50s
 10297344/175810841 [>.............................] - ETA: 50s
 10493952/175810841 [>.............................] - ETA: 50s
 10690560/175810841 [>.............................] - ETA: 50s
 10887168/175810841 [>.............................] - ETA: 50s
 11083776/175810841 [>.............................] - ETA: 50s
 11280384/175810841 [>.............................] - ETA: 50s
 11476992/175810841 [>.............................] - ETA: 50s
 11673600/175810841 [>.............................] - ETA: 50s
 11870208/175810841 [=>............................] - ETA: 50s
 12066816/175810841 [=>............................] - ETA: 50s
 12263424/175810841 [=>............................] - ETA: 49s
 12460032/175810841 [=>............................] - ETA: 49s
 12656640/175810841 [=>............................] - ETA: 49s
 12853248/175810841 [=>............................] - ETA: 49s
 13049856/175810841 [=>............................] - ETA: 49s
 13246464/175810841 [=>............................] - ETA: 49s
 13443072/175810841 [=>............................] - ETA: 49s
 13639680/175810841 [=>............................] - ETA: 49s
 13836288/175810841 [=>............................] - ETA: 49s
 14032896/175810841 [=>............................] - ETA: 49s
 14229504/175810841 [=>............................] - ETA: 49s
 14426112/175810841 [=>............................] - ETA: 49s
 14622720/175810841 [=>............................] - ETA: 49s
 14819328/175810841 [=>............................] - ETA: 49s
 15015936/175810841 [=>............................] - ETA: 48s
 15212544/175810841 [=>............................] - ETA: 48s
 15409152/175810841 [=>............................] - ETA: 48s
 15605760/175810841 [=>............................] - ETA: 48s
 15802368/175810841 [=>............................] - ETA: 48s
 15998976/175810841 [=>............................] - ETA: 48s
 16195584/175810841 [=>............................] - ETA: 48s
 16392192/175810841 [=>............................] - ETA: 48s
 16588800/175810841 [=>............................] - ETA: 48s
 16785408/175810841 [=>............................] - ETA: 48s
 16982016/175810841 [=>............................] - ETA: 48s
 17178624/175810841 [=>............................] - ETA: 48s
 17375232/175810841 [=>............................] - ETA: 48s
 17571840/175810841 [=>............................] - ETA: 48s
 17768448/175810841 [==>...........................] - ETA: 48s
 17965056/175810841 [==>...........................] - ETA: 47s
 18161664/175810841 [==>...........................] - ETA: 47s
 18358272/175810841 [==>...........................] - ETA: 47s
 18554880/175810841 [==>...........................] - ETA: 47s
 18751488/175810841 [==>...........................] - ETA: 47s
 18948096/175810841 [==>...........................] - ETA: 47s
 19144704/175810841 [==>...........................] - ETA: 47s
 19341312/175810841 [==>...........................] - ETA: 47s
 19537920/175810841 [==>...........................] - ETA: 47s
 19734528/175810841 [==>...........................] - ETA: 47s
 19931136/175810841 [==>...........................] - ETA: 47s
 20127744/175810841 [==>...........................] - ETA: 47s
 20324352/175810841 [==>...........................] - ETA: 47s
 20520960/175810841 [==>...........................] - ETA: 47s
 20717568/175810841 [==>...........................] - ETA: 47s
 20914176/175810841 [==>...........................] - ETA: 47s
 21110784/175810841 [==>...........................] - ETA: 46s
 21307392/175810841 [==>...........................] - ETA: 46s
 21504000/175810841 [==>...........................] - ETA: 46s
 21700608/175810841 [==>...........................] - ETA: 46s
 21897216/175810841 [==>...........................] - ETA: 46s
 22093824/175810841 [==>...........................] - ETA: 46s
 22290432/175810841 [==>...........................] - ETA: 46s
 22487040/175810841 [==>...........................] - ETA: 46s
 22683648/175810841 [==>...........................] - ETA: 46s
 22880256/175810841 [==>...........................] - ETA: 46s
 23076864/175810841 [==>...........................] - ETA: 46s
 23273472/175810841 [==>...........................] - ETA: 46s
 23470080/175810841 [===>..........................] - ETA: 46s
 23666688/175810841 [===>..........................] - ETA: 46s
 23863296/175810841 [===>..........................] - ETA: 46s
 24059904/175810841 [===>..........................] - ETA: 46s
 24256512/175810841 [===>..........................] - ETA: 45s
 24453120/175810841 [===>..........................] - ETA: 45s
 24649728/175810841 [===>..........................] - ETA: 45s
 24846336/175810841 [===>..........................] - ETA: 45s
 25042944/175810841 [===>..........................] - ETA: 45s
 25239552/175810841 [===>..........................] - ETA: 45s
 25436160/175810841 [===>..........................] - ETA: 45s
 25632768/175810841 [===>..........................] - ETA: 45s
 25829376/175810841 [===>..........................] - ETA: 45s
 26025984/175810841 [===>..........................] - ETA: 45s
 26222592/175810841 [===>..........................] - ETA: 45s
 26419200/175810841 [===>..........................] - ETA: 45s
 26615808/175810841 [===>..........................] - ETA: 45s
 26812416/175810841 [===>..........................] - ETA: 45s
 27009024/175810841 [===>..........................] - ETA: 45s
 27205632/175810841 [===>..........................] - ETA: 45s
 27402240/175810841 [===>..........................] - ETA: 44s
 27598848/175810841 [===>..........................] - ETA: 44s
 27795456/175810841 [===>..........................] - ETA: 44s
 27992064/175810841 [===>..........................] - ETA: 44s
 28188672/175810841 [===>..........................] - ETA: 44s
 28385280/175810841 [===>..........................] - ETA: 44s
 28581888/175810841 [===>..........................] - ETA: 44s
 28778496/175810841 [===>..........................] - ETA: 44s
 28975104/175810841 [===>..........................] - ETA: 44s
 29171712/175810841 [===>..........................] - ETA: 44s
 29368320/175810841 [====>.........................] - ETA: 44s
 29564928/175810841 [====>.........................] - ETA: 44s
 29761536/175810841 [====>.........................] - ETA: 44s
 29958144/175810841 [====>.........................] - ETA: 44s
 30154752/175810841 [====>.........................] - ETA: 44s
 30351360/175810841 [====>.........................] - ETA: 44s
 30547968/175810841 [====>.........................] - ETA: 43s
 30744576/175810841 [====>.........................] - ETA: 43s
 30941184/175810841 [====>.........................] - ETA: 43s
 31137792/175810841 [====>.........................] - ETA: 43s
 31334400/175810841 [====>.........................] - ETA: 43s
 31531008/175810841 [====>.........................] - ETA: 43s
 31727616/175810841 [====>.........................] - ETA: 43s
 31924224/175810841 [====>.........................] - ETA: 43s
 32120832/175810841 [====>.........................] - ETA: 43s
 32317440/175810841 [====>.........................] - ETA: 43s
 32514048/175810841 [====>.........................] - ETA: 43s
 32710656/175810841 [====>.........................] - ETA: 43s
 32907264/175810841 [====>.........................] - ETA: 43s
 33103872/175810841 [====>.........................] - ETA: 43s
 33300480/175810841 [====>.........................] - ETA: 43s
 33497088/175810841 [====>.........................] - ETA: 43s
 33693696/175810841 [====>.........................] - ETA: 43s
 33890304/175810841 [====>.........................] - ETA: 42s
 34086912/175810841 [====>.........................] - ETA: 42s
 34283520/175810841 [====>.........................] - ETA: 42s
 34480128/175810841 [====>.........................] - ETA: 42s
 34676736/175810841 [====>.........................] - ETA: 42s
 34873344/175810841 [====>.........................] - ETA: 42s
 35069952/175810841 [====>.........................] - ETA: 42s
 35266560/175810841 [=====>........................] - ETA: 42s
 35463168/175810841 [=====>........................] - ETA: 42s
 35659776/175810841 [=====>........................] - ETA: 42s
 35856384/175810841 [=====>........................] - ETA: 42s
 36052992/175810841 [=====>........................] - ETA: 42s
 36249600/175810841 [=====>........................] - ETA: 42s
 36446208/175810841 [=====>........................] - ETA: 42s
 36642816/175810841 [=====>........................] - ETA: 42s
 36839424/175810841 [=====>........................] - ETA: 42s
 37036032/175810841 [=====>........................] - ETA: 41s
 37232640/175810841 [=====>........................] - ETA: 41s
 37429248/175810841 [=====>........................] - ETA: 41s
 37625856/175810841 [=====>........................] - ETA: 41s
 37822464/175810841 [=====>........................] - ETA: 41s
 38019072/175810841 [=====>........................] - ETA: 41s
 38215680/175810841 [=====>........................] - ETA: 41s
 38412288/175810841 [=====>........................] - ETA: 41s
 38608896/175810841 [=====>........................] - ETA: 41s
 38805504/175810841 [=====>........................] - ETA: 41s
 39002112/175810841 [=====>........................] - ETA: 41s
 39198720/175810841 [=====>........................] - ETA: 41s
 39395328/175810841 [=====>........................] - ETA: 41s
 39591936/175810841 [=====>........................] - ETA: 41s
 39788544/175810841 [=====>........................] - ETA: 41s
 39985152/175810841 [=====>........................] - ETA: 41s
 40181760/175810841 [=====>........................] - ETA: 41s
 40378368/175810841 [=====>........................] - ETA: 40s
 40574976/175810841 [=====>........................] - ETA: 40s
 40771584/175810841 [=====>........................] - ETA: 40s
 40968192/175810841 [=====>........................] - ETA: 40s
 41164800/175810841 [======>.......................] - ETA: 40s
 41361408/175810841 [======>.......................] - ETA: 40s
 41558016/175810841 [======>.......................] - ETA: 40s
 41754624/175810841 [======>.......................] - ETA: 40s
 41951232/175810841 [======>.......................] - ETA: 40s
 42147840/175810841 [======>.......................] - ETA: 40s
 42344448/175810841 [======>.......................] - ETA: 40s
 42541056/175810841 [======>.......................] - ETA: 40s
 42737664/175810841 [======>.......................] - ETA: 40s
 42934272/175810841 [======>.......................] - ETA: 40s
 43130880/175810841 [======>.......................] - ETA: 40s
 43327488/175810841 [======>.......................] - ETA: 40s
 43524096/175810841 [======>.......................] - ETA: 39s
 43720704/175810841 [======>.......................] - ETA: 39s
 43917312/175810841 [======>.......................] - ETA: 39s
 44113920/175810841 [======>.......................] - ETA: 39s
 44310528/175810841 [======>.......................] - ETA: 39s
 44507136/175810841 [======>.......................] - ETA: 39s
 44703744/175810841 [======>.......................] - ETA: 39s
 44900352/175810841 [======>.......................] - ETA: 39s
 45096960/175810841 [======>.......................] - ETA: 39s
 45293568/175810841 [======>.......................] - ETA: 39s
 45490176/175810841 [======>.......................] - ETA: 39s
 45686784/175810841 [======>.......................] - ETA: 39s
 45883392/175810841 [======>.......................] - ETA: 39s
 46080000/175810841 [======>.......................] - ETA: 39s
 46276608/175810841 [======>.......................] - ETA: 39s
 46473216/175810841 [======>.......................] - ETA: 39s
 46669824/175810841 [======>.......................] - ETA: 39s
 46866432/175810841 [======>.......................] - ETA: 38s
 47063040/175810841 [=======>......................] - ETA: 38s
 47259648/175810841 [=======>......................] - ETA: 38s
 47456256/175810841 [=======>......................] - ETA: 38s
 47652864/175810841 [=======>......................] - ETA: 38s
 47849472/175810841 [=======>......................] - ETA: 38s
 48046080/175810841 [=======>......................] - ETA: 38s
 48242688/175810841 [=======>......................] - ETA: 38s
 48439296/175810841 [=======>......................] - ETA: 38s
 48635904/175810841 [=======>......................] - ETA: 38s
 48832512/175810841 [=======>......................] - ETA: 38s
 49029120/175810841 [=======>......................] - ETA: 38s
 49225728/175810841 [=======>......................] - ETA: 38s
 49422336/175810841 [=======>......................] - ETA: 38s
 49618944/175810841 [=======>......................] - ETA: 38s
 49815552/175810841 [=======>......................] - ETA: 38s
 50012160/175810841 [=======>......................] - ETA: 38s
 50208768/175810841 [=======>......................] - ETA: 37s
 50405376/175810841 [=======>......................] - ETA: 37s
 50601984/175810841 [=======>......................] - ETA: 37s
 50798592/175810841 [=======>......................] - ETA: 37s
 50995200/175810841 [=======>......................] - ETA: 37s
 51191808/175810841 [=======>......................] - ETA: 37s
 51388416/175810841 [=======>......................] - ETA: 37s
 51585024/175810841 [=======>......................] - ETA: 37s
 51781632/175810841 [=======>......................] - ETA: 37s
 51978240/175810841 [=======>......................] - ETA: 37s
 52174848/175810841 [=======>......................] - ETA: 37s
 52371456/175810841 [=======>......................] - ETA: 37s
 52568064/175810841 [=======>......................] - ETA: 37s
 52764672/175810841 [========>.....................] - ETA: 37s
 52961280/175810841 [========>.....................] - ETA: 37s
 53157888/175810841 [========>.....................] - ETA: 37s
 53354496/175810841 [========>.....................] - ETA: 36s
 53551104/175810841 [========>.....................] - ETA: 36s
 53747712/175810841 [========>.....................] - ETA: 36s
 53944320/175810841 [========>.....................] - ETA: 36s
 54140928/175810841 [========>.....................] - ETA: 36s
 54337536/175810841 [========>.....................] - ETA: 36s
 54534144/175810841 [========>.....................] - ETA: 36s
 54730752/175810841 [========>.....................] - ETA: 36s
 54927360/175810841 [========>.....................] - ETA: 36s
 55123968/175810841 [========>.....................] - ETA: 36s
 55320576/175810841 [========>.....................] - ETA: 36s
 55517184/175810841 [========>.....................] - ETA: 36s
 55713792/175810841 [========>.....................] - ETA: 36s
 55910400/175810841 [========>.....................] - ETA: 36s
 56107008/175810841 [========>.....................] - ETA: 36s
 56303616/175810841 [========>.....................] - ETA: 36s
 56500224/175810841 [========>.....................] - ETA: 36s
 56696832/175810841 [========>.....................] - ETA: 35s
 56893440/175810841 [========>.....................] - ETA: 35s
 57090048/175810841 [========>.....................] - ETA: 35s
 57286656/175810841 [========>.....................] - ETA: 35s
 57483264/175810841 [========>.....................] - ETA: 35s
 57679872/175810841 [========>.....................] - ETA: 35s
 57876480/175810841 [========>.....................] - ETA: 35s
 58073088/175810841 [========>.....................] - ETA: 35s
 58269696/175810841 [========>.....................] - ETA: 35s
 58466304/175810841 [========>.....................] - ETA: 35s
 58662912/175810841 [=========>....................] - ETA: 35s
 58859520/175810841 [=========>....................] - ETA: 35s
 59056128/175810841 [=========>....................] - ETA: 35s
 59252736/175810841 [=========>....................] - ETA: 35s
 59449344/175810841 [=========>....................] - ETA: 35s
 59645952/175810841 [=========>....................] - ETA: 35s
 59842560/175810841 [=========>....................] - ETA: 35s
 60039168/175810841 [=========>....................] - ETA: 34s
 60235776/175810841 [=========>....................] - ETA: 34s
 60432384/175810841 [=========>....................] - ETA: 34s
 60628992/175810841 [=========>....................] - ETA: 34s
 60825600/175810841 [=========>....................] - ETA: 34s
 61022208/175810841 [=========>....................] - ETA: 34s
 61218816/175810841 [=========>....................] - ETA: 34s
 61415424/175810841 [=========>....................] - ETA: 34s
 61612032/175810841 [=========>....................] - ETA: 34s
 61808640/175810841 [=========>....................] - ETA: 34s
 62005248/175810841 [=========>....................] - ETA: 34s
 62201856/175810841 [=========>....................] - ETA: 34s
 62398464/175810841 [=========>....................] - ETA: 34s
 62595072/175810841 [=========>....................] - ETA: 34s
 62791680/175810841 [=========>....................] - ETA: 34s
 62988288/175810841 [=========>....................] - ETA: 34s
 63184896/175810841 [=========>....................] - ETA: 33s
 63381504/175810841 [=========>....................] - ETA: 33s
 63578112/175810841 [=========>....................] - ETA: 33s
 63774720/175810841 [=========>....................] - ETA: 33s
 63971328/175810841 [=========>....................] - ETA: 33s
 64167936/175810841 [=========>....................] - ETA: 33s
 64364544/175810841 [=========>....................] - ETA: 33s
 64561152/175810841 [==========>...................] - ETA: 33s
 64757760/175810841 [==========>...................] - ETA: 33s
 64954368/175810841 [==========>...................] - ETA: 33s
 65150976/175810841 [==========>...................] - ETA: 33s
 65347584/175810841 [==========>...................] - ETA: 33s
 65544192/175810841 [==========>...................] - ETA: 33s
 65740800/175810841 [==========>...................] - ETA: 33s
 65937408/175810841 [==========>...................] - ETA: 33s
 66134016/175810841 [==========>...................] - ETA: 33s
 66330624/175810841 [==========>...................] - ETA: 33s
 66527232/175810841 [==========>...................] - ETA: 32s
 66723840/175810841 [==========>...................] - ETA: 32s
 66920448/175810841 [==========>...................] - ETA: 32s
 67117056/175810841 [==========>...................] - ETA: 32s
 67313664/175810841 [==========>...................] - ETA: 32s
 67510272/175810841 [==========>...................] - ETA: 32s
 67706880/175810841 [==========>...................] - ETA: 32s
 67903488/175810841 [==========>...................] - ETA: 32s
 68100096/175810841 [==========>...................] - ETA: 32s
 68296704/175810841 [==========>...................] - ETA: 32s
 68493312/175810841 [==========>...................] - ETA: 32s
 68689920/175810841 [==========>...................] - ETA: 32s
 68886528/175810841 [==========>...................] - ETA: 32s
 69083136/175810841 [==========>...................] - ETA: 32s
 69279744/175810841 [==========>...................] - ETA: 32s
 69476352/175810841 [==========>...................] - ETA: 32s
 69672960/175810841 [==========>...................] - ETA: 32s
 69869568/175810841 [==========>...................] - ETA: 31s
 70066176/175810841 [==========>...................] - ETA: 31s
 70262784/175810841 [==========>...................] - ETA: 31s
 70459392/175810841 [===========>..................] - ETA: 31s
 70656000/175810841 [===========>..................] - ETA: 31s
 70852608/175810841 [===========>..................] - ETA: 31s
 71049216/175810841 [===========>..................] - ETA: 31s
 71245824/175810841 [===========>..................] - ETA: 31s
 71442432/175810841 [===========>..................] - ETA: 31s
 71639040/175810841 [===========>..................] - ETA: 31s
 71835648/175810841 [===========>..................] - ETA: 31s
 72032256/175810841 [===========>..................] - ETA: 31s
 72228864/175810841 [===========>..................] - ETA: 31s
 72425472/175810841 [===========>..................] - ETA: 31s
 72622080/175810841 [===========>..................] - ETA: 31s
 72818688/175810841 [===========>..................] - ETA: 31s
 73015296/175810841 [===========>..................] - ETA: 31s
 73211904/175810841 [===========>..................] - ETA: 30s
 73408512/175810841 [===========>..................] - ETA: 30s
 73605120/175810841 [===========>..................] - ETA: 30s
 73801728/175810841 [===========>..................] - ETA: 30s
 73998336/175810841 [===========>..................] - ETA: 30s
 74194944/175810841 [===========>..................] - ETA: 30s
 74391552/175810841 [===========>..................] - ETA: 30s
 74588160/175810841 [===========>..................] - ETA: 30s
 74784768/175810841 [===========>..................] - ETA: 30s
 74981376/175810841 [===========>..................] - ETA: 30s
 75177984/175810841 [===========>..................] - ETA: 30s
 75374592/175810841 [===========>..................] - ETA: 30s
 75571200/175810841 [===========>..................] - ETA: 30s
 75767808/175810841 [===========>..................] - ETA: 30s
 75964416/175810841 [===========>..................] - ETA: 30s
 76161024/175810841 [===========>..................] - ETA: 30s
 76357632/175810841 [============>.................] - ETA: 30s
 76554240/175810841 [============>.................] - ETA: 29s
 76750848/175810841 [============>.................] - ETA: 29s
 76947456/175810841 [============>.................] - ETA: 29s
 77144064/175810841 [============>.................] - ETA: 29s
 77340672/175810841 [============>.................] - ETA: 29s
 77537280/175810841 [============>.................] - ETA: 29s
 77733888/175810841 [============>.................] - ETA: 29s
 77930496/175810841 [============>.................] - ETA: 29s
 78127104/175810841 [============>.................] - ETA: 29s
 78323712/175810841 [============>.................] - ETA: 29s
 78520320/175810841 [============>.................] - ETA: 29s
 78716928/175810841 [============>.................] - ETA: 29s
 78913536/175810841 [============>.................] - ETA: 29s
 79110144/175810841 [============>.................] - ETA: 29s
 79306752/175810841 [============>.................] - ETA: 29s
 79503360/175810841 [============>.................] - ETA: 29s
 79699968/175810841 [============>.................] - ETA: 28s
 79896576/175810841 [============>.................] - ETA: 28s
 80093184/175810841 [============>.................] - ETA: 28s
 80289792/175810841 [============>.................] - ETA: 28s
 80486400/175810841 [============>.................] - ETA: 28s
 80683008/175810841 [============>.................] - ETA: 28s
 80879616/175810841 [============>.................] - ETA: 28s
 81076224/175810841 [============>.................] - ETA: 28s
 81272832/175810841 [============>.................] - ETA: 28s
 81469440/175810841 [============>.................] - ETA: 28s
 81666048/175810841 [============>.................] - ETA: 28s
 81862656/175810841 [============>.................] - ETA: 28s
 82059264/175810841 [=============>................] - ETA: 28s
 82255872/175810841 [=============>................] - ETA: 28s
 82452480/175810841 [=============>................] - ETA: 28s
 82649088/175810841 [=============>................] - ETA: 28s
 82845696/175810841 [=============>................] - ETA: 28s
 83042304/175810841 [=============>................] - ETA: 27s
 83238912/175810841 [=============>................] - ETA: 27s
 83435520/175810841 [=============>................] - ETA: 27s
 83632128/175810841 [=============>................] - ETA: 27s
 83828736/175810841 [=============>................] - ETA: 27s
 84025344/175810841 [=============>................] - ETA: 27s
 84221952/175810841 [=============>................] - ETA: 27s
 84418560/175810841 [=============>................] - ETA: 27s
 84615168/175810841 [=============>................] - ETA: 27s
 84811776/175810841 [=============>................] - ETA: 27s
 85008384/175810841 [=============>................] - ETA: 27s
 85204992/175810841 [=============>................] - ETA: 27s
 85401600/175810841 [=============>................] - ETA: 27s
 85598208/175810841 [=============>................] - ETA: 27s
 85794816/175810841 [=============>................] - ETA: 27s
 85991424/175810841 [=============>................] - ETA: 27s
 86188032/175810841 [=============>................] - ETA: 27s
 86384640/175810841 [=============>................] - ETA: 26s
 86581248/175810841 [=============>................] - ETA: 26s
 86777856/175810841 [=============>................] - ETA: 26s
 86974464/175810841 [=============>................] - ETA: 26s
 87171072/175810841 [=============>................] - ETA: 26s
 87367680/175810841 [=============>................] - ETA: 26s
 87564288/175810841 [=============>................] - ETA: 26s
 87760896/175810841 [=============>................] - ETA: 26s
 87957504/175810841 [==============>...............] - ETA: 26s
 88154112/175810841 [==============>...............] - ETA: 26s
 88350720/175810841 [==============>...............] - ETA: 26s
 88547328/175810841 [==============>...............] - ETA: 26s
 88743936/175810841 [==============>...............] - ETA: 26s
 88940544/175810841 [==============>...............] - ETA: 26s
 89137152/175810841 [==============>...............] - ETA: 26s
 89333760/175810841 [==============>...............] - ETA: 26s
 89530368/175810841 [==============>...............] - ETA: 26s
 89726976/175810841 [==============>...............] - ETA: 25s
 89923584/175810841 [==============>...............] - ETA: 25s
 90120192/175810841 [==============>...............] - ETA: 25s
 90316800/175810841 [==============>...............] - ETA: 25s
 90513408/175810841 [==============>...............] - ETA: 25s
 90710016/175810841 [==============>...............] - ETA: 25s
 90906624/175810841 [==============>...............] - ETA: 25s
 91103232/175810841 [==============>...............] - ETA: 25s
 91299840/175810841 [==============>...............] - ETA: 25s
 91496448/175810841 [==============>...............] - ETA: 25s
 91693056/175810841 [==============>...............] - ETA: 25s
 91889664/175810841 [==============>...............] - ETA: 25s
 92086272/175810841 [==============>...............] - ETA: 25s
 92282880/175810841 [==============>...............] - ETA: 25s
 92479488/175810841 [==============>...............] - ETA: 25s
 92676096/175810841 [==============>...............] - ETA: 25s
 92872704/175810841 [==============>...............] - ETA: 25s
 93069312/175810841 [==============>...............] - ETA: 24s
 93265920/175810841 [==============>...............] - ETA: 24s
 93462528/175810841 [==============>...............] - ETA: 24s
 93659136/175810841 [==============>...............] - ETA: 24s
 93855744/175810841 [===============>..............] - ETA: 24s
 94052352/175810841 [===============>..............] - ETA: 24s
 94248960/175810841 [===============>..............] - ETA: 24s
 94445568/175810841 [===============>..............] - ETA: 24s
 94642176/175810841 [===============>..............] - ETA: 24s
 94838784/175810841 [===============>..............] - ETA: 24s
 95035392/175810841 [===============>..............] - ETA: 24s
 95232000/175810841 [===============>..............] - ETA: 24s
 95428608/175810841 [===============>..............] - ETA: 24s
 95625216/175810841 [===============>..............] - ETA: 24s
 95821824/175810841 [===============>..............] - ETA: 24s
 96018432/175810841 [===============>..............] - ETA: 24s
 96215040/175810841 [===============>..............] - ETA: 24s
 96411648/175810841 [===============>..............] - ETA: 23s
 96608256/175810841 [===============>..............] - ETA: 23s
 96804864/175810841 [===============>..............] - ETA: 23s
 97001472/175810841 [===============>..............] - ETA: 23s
 97198080/175810841 [===============>..............] - ETA: 23s
 97394688/175810841 [===============>..............] - ETA: 23s
 97591296/175810841 [===============>..............] - ETA: 23s
 97787904/175810841 [===============>..............] - ETA: 23s
 97984512/175810841 [===============>..............] - ETA: 23s
 98181120/175810841 [===============>..............] - ETA: 23s
 98377728/175810841 [===============>..............] - ETA: 23s
 98574336/175810841 [===============>..............] - ETA: 23s
 98770944/175810841 [===============>..............] - ETA: 23s
 98967552/175810841 [===============>..............] - ETA: 23s
 99164160/175810841 [===============>..............] - ETA: 23s
 99360768/175810841 [===============>..............] - ETA: 23s
 99557376/175810841 [===============>..............] - ETA: 22s
 99753984/175810841 [================>.............] - ETA: 22s
 99950592/175810841 [================>.............] - ETA: 22s
100147200/175810841 [================>.............] - ETA: 22s
100343808/175810841 [================>.............] - ETA: 22s
100540416/175810841 [================>.............] - ETA: 22s
100737024/175810841 [================>.............] - ETA: 22s
100933632/175810841 [================>.............] - ETA: 22s
101130240/175810841 [================>.............] - ETA: 22s
101326848/175810841 [================>.............] - ETA: 22s
101523456/175810841 [================>.............] - ETA: 22s
101720064/175810841 [================>.............] - ETA: 22s
101916672/175810841 [================>.............] - ETA: 22s
102113280/175810841 [================>.............] - ETA: 22s
102309888/175810841 [================>.............] - ETA: 22s
102506496/175810841 [================>.............] - ETA: 22s
102703104/175810841 [================>.............] - ETA: 22s
102899712/175810841 [================>.............] - ETA: 21s
103096320/175810841 [================>.............] - ETA: 21s
103292928/175810841 [================>.............] - ETA: 21s
103489536/175810841 [================>.............] - ETA: 21s
103686144/175810841 [================>.............] - ETA: 21s
103882752/175810841 [================>.............] - ETA: 21s
104079360/175810841 [================>.............] - ETA: 21s
104275968/175810841 [================>.............] - ETA: 21s
104472576/175810841 [================>.............] - ETA: 21s
104669184/175810841 [================>.............] - ETA: 21s
104865792/175810841 [================>.............] - ETA: 21s
105062400/175810841 [================>.............] - ETA: 21s
105259008/175810841 [================>.............] - ETA: 21s
105455616/175810841 [================>.............] - ETA: 21s
105652224/175810841 [=================>............] - ETA: 21s
105848832/175810841 [=================>............] - ETA: 21s
106045440/175810841 [=================>............] - ETA: 21s
106242048/175810841 [=================>............] - ETA: 20s
106438656/175810841 [=================>............] - ETA: 20s
106635264/175810841 [=================>............] - ETA: 20s
106831872/175810841 [=================>............] - ETA: 20s
107028480/175810841 [=================>............] - ETA: 20s
107225088/175810841 [=================>............] - ETA: 20s
107421696/175810841 [=================>............] - ETA: 20s
107618304/175810841 [=================>............] - ETA: 20s
107814912/175810841 [=================>............] - ETA: 20s
108011520/175810841 [=================>............] - ETA: 20s
108208128/175810841 [=================>............] - ETA: 20s
108404736/175810841 [=================>............] - ETA: 20s
108601344/175810841 [=================>............] - ETA: 20s
108797952/175810841 [=================>............] - ETA: 20s
108994560/175810841 [=================>............] - ETA: 20s
109191168/175810841 [=================>............] - ETA: 20s
109387776/175810841 [=================>............] - ETA: 20s
109584384/175810841 [=================>............] - ETA: 19s
109780992/175810841 [=================>............] - ETA: 19s
109977600/175810841 [=================>............] - ETA: 19s
110174208/175810841 [=================>............] - ETA: 19s
110370816/175810841 [=================>............] - ETA: 19s
110567424/175810841 [=================>............] - ETA: 19s
110764032/175810841 [=================>............] - ETA: 19s
110960640/175810841 [=================>............] - ETA: 19s
111157248/175810841 [=================>............] - ETA: 19s
111353856/175810841 [==================>...........] - ETA: 19s
111550464/175810841 [==================>...........] - ETA: 19s
111747072/175810841 [==================>...........] - ETA: 19s
111943680/175810841 [==================>...........] - ETA: 19s
112140288/175810841 [==================>...........] - ETA: 19s
112336896/175810841 [==================>...........] - ETA: 19s
112533504/175810841 [==================>...........] - ETA: 19s
112730112/175810841 [==================>...........] - ETA: 19s
112926720/175810841 [==================>...........] - ETA: 18s
113123328/175810841 [==================>...........] - ETA: 18s
113319936/175810841 [==================>...........] - ETA: 18s
113516544/175810841 [==================>...........] - ETA: 18s
113713152/175810841 [==================>...........] - ETA: 18s
113909760/175810841 [==================>...........] - ETA: 18s
114106368/175810841 [==================>...........] - ETA: 18s
114302976/175810841 [==================>...........] - ETA: 18s
114499584/175810841 [==================>...........] - ETA: 18s
114696192/175810841 [==================>...........] - ETA: 18s
114892800/175810841 [==================>...........] - ETA: 18s
115089408/175810841 [==================>...........] - ETA: 18s
115286016/175810841 [==================>...........] - ETA: 18s
115482624/175810841 [==================>...........] - ETA: 18s
115679232/175810841 [==================>...........] - ETA: 18s
115875840/175810841 [==================>...........] - ETA: 18s
116072448/175810841 [==================>...........] - ETA: 18s
116269056/175810841 [==================>...........] - ETA: 17s
116465664/175810841 [==================>...........] - ETA: 17s
116662272/175810841 [==================>...........] - ETA: 17s
116858880/175810841 [==================>...........] - ETA: 17s
117055488/175810841 [==================>...........] - ETA: 17s
117252096/175810841 [===================>..........] - ETA: 17s
117448704/175810841 [===================>..........] - ETA: 17s
117645312/175810841 [===================>..........] - ETA: 17s
117841920/175810841 [===================>..........] - ETA: 17s
118038528/175810841 [===================>..........] - ETA: 17s
118235136/175810841 [===================>..........] - ETA: 17s
118431744/175810841 [===================>..........] - ETA: 17s
118628352/175810841 [===================>..........] - ETA: 17s
118824960/175810841 [===================>..........] - ETA: 17s
119021568/175810841 [===================>..........] - ETA: 17s
119218176/175810841 [===================>..........] - ETA: 17s
119414784/175810841 [===================>..........] - ETA: 17s
119611392/175810841 [===================>..........] - ETA: 16s
119808000/175810841 [===================>..........] - ETA: 16s
120004608/175810841 [===================>..........] - ETA: 16s
120201216/175810841 [===================>..........] - ETA: 16s
120397824/175810841 [===================>..........] - ETA: 16s
120594432/175810841 [===================>..........] - ETA: 16s
120791040/175810841 [===================>..........] - ETA: 16s
120987648/175810841 [===================>..........] - ETA: 16s
121184256/175810841 [===================>..........] - ETA: 16s
121380864/175810841 [===================>..........] - ETA: 16s
121577472/175810841 [===================>..........] - ETA: 16s
121774080/175810841 [===================>..........] - ETA: 16s
121970688/175810841 [===================>..........] - ETA: 16s
122167296/175810841 [===================>..........] - ETA: 16s
122363904/175810841 [===================>..........] - ETA: 16s
122560512/175810841 [===================>..........] - ETA: 16s
122757120/175810841 [===================>..........] - ETA: 15s
122953728/175810841 [===================>..........] - ETA: 15s
123150336/175810841 [====================>.........] - ETA: 15s
123346944/175810841 [====================>.........] - ETA: 15s
123543552/175810841 [====================>.........] - ETA: 15s
123740160/175810841 [====================>.........] - ETA: 15s
123936768/175810841 [====================>.........] - ETA: 15s
124133376/175810841 [====================>.........] - ETA: 15s
124329984/175810841 [====================>.........] - ETA: 15s
124526592/175810841 [====================>.........] - ETA: 15s
124723200/175810841 [====================>.........] - ETA: 15s
124919808/175810841 [====================>.........] - ETA: 15s
125116416/175810841 [====================>.........] - ETA: 15s
125313024/175810841 [====================>.........] - ETA: 15s
125509632/175810841 [====================>.........] - ETA: 15s
125706240/175810841 [====================>.........] - ETA: 15s
125902848/175810841 [====================>.........] - ETA: 15s
126099456/175810841 [====================>.........] - ETA: 14s
126296064/175810841 [====================>.........] - ETA: 14s
126492672/175810841 [====================>.........] - ETA: 14s
126689280/175810841 [====================>.........] - ETA: 14s
126885888/175810841 [====================>.........] - ETA: 14s
127082496/175810841 [====================>.........] - ETA: 14s
127279104/175810841 [====================>.........] - ETA: 14s
127475712/175810841 [====================>.........] - ETA: 14s
127672320/175810841 [====================>.........] - ETA: 14s
127868928/175810841 [====================>.........] - ETA: 14s
128065536/175810841 [====================>.........] - ETA: 14s
128262144/175810841 [====================>.........] - ETA: 14s
128458752/175810841 [====================>.........] - ETA: 14s
128655360/175810841 [====================>.........] - ETA: 14s
128851968/175810841 [====================>.........] - ETA: 14s
129048576/175810841 [=====================>........] - ETA: 14s
129245184/175810841 [=====================>........] - ETA: 14s
129441792/175810841 [=====================>........] - ETA: 13s
129638400/175810841 [=====================>........] - ETA: 13s
129835008/175810841 [=====================>........] - ETA: 13s
130031616/175810841 [=====================>........] - ETA: 13s
130228224/175810841 [=====================>........] - ETA: 13s
130424832/175810841 [=====================>........] - ETA: 13s
130621440/175810841 [=====================>........] - ETA: 13s
130818048/175810841 [=====================>........] - ETA: 13s
131014656/175810841 [=====================>........] - ETA: 13s
131211264/175810841 [=====================>........] - ETA: 13s
131407872/175810841 [=====================>........] - ETA: 13s
131604480/175810841 [=====================>........] - ETA: 13s
131801088/175810841 [=====================>........] - ETA: 13s
131997696/175810841 [=====================>........] - ETA: 13s
132194304/175810841 [=====================>........] - ETA: 13s
132390912/175810841 [=====================>........] - ETA: 13s
132587520/175810841 [=====================>........] - ETA: 13s
132784128/175810841 [=====================>........] - ETA: 12s
132980736/175810841 [=====================>........] - ETA: 12s
133177344/175810841 [=====================>........] - ETA: 12s
133373952/175810841 [=====================>........] - ETA: 12s
133570560/175810841 [=====================>........] - ETA: 12s
133767168/175810841 [=====================>........] - ETA: 12s
133963776/175810841 [=====================>........] - ETA: 12s
134160384/175810841 [=====================>........] - ETA: 12s
134356992/175810841 [=====================>........] - ETA: 12s
134553600/175810841 [=====================>........] - ETA: 12s
134750208/175810841 [=====================>........] - ETA: 12s
134946816/175810841 [======================>.......] - ETA: 12s
135143424/175810841 [======================>.......] - ETA: 12s
135340032/175810841 [======================>.......] - ETA: 12s
135536640/175810841 [======================>.......] - ETA: 12s
135733248/175810841 [======================>.......] - ETA: 12s
135929856/175810841 [======================>.......] - ETA: 12s
136126464/175810841 [======================>.......] - ETA: 11s
136323072/175810841 [======================>.......] - ETA: 11s
136519680/175810841 [======================>.......] - ETA: 11s
136716288/175810841 [======================>.......] - ETA: 11s
136912896/175810841 [======================>.......] - ETA: 11s
137109504/175810841 [======================>.......] - ETA: 11s
137306112/175810841 [======================>.......] - ETA: 11s
137502720/175810841 [======================>.......] - ETA: 11s
137699328/175810841 [======================>.......] - ETA: 11s
137895936/175810841 [======================>.......] - ETA: 11s
138092544/175810841 [======================>.......] - ETA: 11s
138289152/175810841 [======================>.......] - ETA: 11s
138485760/175810841 [======================>.......] - ETA: 11s
138682368/175810841 [======================>.......] - ETA: 11s
138878976/175810841 [======================>.......] - ETA: 11s
139075584/175810841 [======================>.......] - ETA: 11s
139272192/175810841 [======================>.......] - ETA: 11s
139468800/175810841 [======================>.......] - ETA: 10s
139665408/175810841 [======================>.......] - ETA: 10s
139862016/175810841 [======================>.......] - ETA: 10s
140058624/175810841 [======================>.......] - ETA: 10s
140255232/175810841 [======================>.......] - ETA: 10s
140451840/175810841 [======================>.......] - ETA: 10s
140648448/175810841 [======================>.......] - ETA: 10s
140845056/175810841 [=======================>......] - ETA: 10s
141041664/175810841 [=======================>......] - ETA: 10s
141238272/175810841 [=======================>......] - ETA: 10s
141434880/175810841 [=======================>......] - ETA: 10s
141631488/175810841 [=======================>......] - ETA: 10s
141828096/175810841 [=======================>......] - ETA: 10s
142024704/175810841 [=======================>......] - ETA: 10s
142221312/175810841 [=======================>......] - ETA: 10s
142417920/175810841 [=======================>......] - ETA: 10s
142614528/175810841 [=======================>......] - ETA: 10s
142811136/175810841 [=======================>......] - ETA: 9s 
143007744/175810841 [=======================>......] - ETA: 9s
143204352/175810841 [=======================>......] - ETA: 9s
143400960/175810841 [=======================>......] - ETA: 9s
143597568/175810841 [=======================>......] - ETA: 9s
143794176/175810841 [=======================>......] - ETA: 9s
143990784/175810841 [=======================>......] - ETA: 9s
144187392/175810841 [=======================>......] - ETA: 9s
144384000/175810841 [=======================>......] - ETA: 9s
144580608/175810841 [=======================>......] - ETA: 9s
144777216/175810841 [=======================>......] - ETA: 9s
144973824/175810841 [=======================>......] - ETA: 9s
145170432/175810841 [=======================>......] - ETA: 9s
145367040/175810841 [=======================>......] - ETA: 9s
145563648/175810841 [=======================>......] - ETA: 9s
145760256/175810841 [=======================>......] - ETA: 9s
145956864/175810841 [=======================>......] - ETA: 9s
146153472/175810841 [=======================>......] - ETA: 8s
146350080/175810841 [=======================>......] - ETA: 8s
146546688/175810841 [========================>.....] - ETA: 8s
146743296/175810841 [========================>.....] - ETA: 8s
146939904/175810841 [========================>.....] - ETA: 8s
147136512/175810841 [========================>.....] - ETA: 8s
147333120/175810841 [========================>.....] - ETA: 8s
147529728/175810841 [========================>.....] - ETA: 8s
147726336/175810841 [========================>.....] - ETA: 8s
147922944/175810841 [========================>.....] - ETA: 8s
148119552/175810841 [========================>.....] - ETA: 8s
148316160/175810841 [========================>.....] - ETA: 8s
148512768/175810841 [========================>.....] - ETA: 8s
148709376/175810841 [========================>.....] - ETA: 8s
148905984/175810841 [========================>.....] - ETA: 8s
149102592/175810841 [========================>.....] - ETA: 8s
149299200/175810841 [========================>.....] - ETA: 8s
149495808/175810841 [========================>.....] - ETA: 7s
149692416/175810841 [========================>.....] - ETA: 7s
149889024/175810841 [========================>.....] - ETA: 7s
150085632/175810841 [========================>.....] - ETA: 7s
150282240/175810841 [========================>.....] - ETA: 7s
150478848/175810841 [========================>.....] - ETA: 7s
150675456/175810841 [========================>.....] - ETA: 7s
150872064/175810841 [========================>.....] - ETA: 7s
151068672/175810841 [========================>.....] - ETA: 7s
151265280/175810841 [========================>.....] - ETA: 7s
151461888/175810841 [========================>.....] - ETA: 7s
151658496/175810841 [========================>.....] - ETA: 7s
151855104/175810841 [========================>.....] - ETA: 7s
152051712/175810841 [========================>.....] - ETA: 7s
152248320/175810841 [========================>.....] - ETA: 7s
152444928/175810841 [=========================>....] - ETA: 7s
152641536/175810841 [=========================>....] - ETA: 6s
152838144/175810841 [=========================>....] - ETA: 6s
153034752/175810841 [=========================>....] - ETA: 6s
153231360/175810841 [=========================>....] - ETA: 6s
153427968/175810841 [=========================>....] - ETA: 6s
153624576/175810841 [=========================>....] - ETA: 6s
153821184/175810841 [=========================>....] - ETA: 6s
154017792/175810841 [=========================>....] - ETA: 6s
154214400/175810841 [=========================>....] - ETA: 6s
154411008/175810841 [=========================>....] - ETA: 6s
154607616/175810841 [=========================>....] - ETA: 6s
154804224/175810841 [=========================>....] - ETA: 6s
155000832/175810841 [=========================>....] - ETA: 6s
155197440/175810841 [=========================>....] - ETA: 6s
155394048/175810841 [=========================>....] - ETA: 6s
155590656/175810841 [=========================>....] - ETA: 6s
155787264/175810841 [=========================>....] - ETA: 6s
155983872/175810841 [=========================>....] - ETA: 5s
156180480/175810841 [=========================>....] - ETA: 5s
156377088/175810841 [=========================>....] - ETA: 5s
156573696/175810841 [=========================>....] - ETA: 5s
156770304/175810841 [=========================>....] - ETA: 5s
156966912/175810841 [=========================>....] - ETA: 5s
157163520/175810841 [=========================>....] - ETA: 5s
157360128/175810841 [=========================>....] - ETA: 5s
157556736/175810841 [=========================>....] - ETA: 5s
157753344/175810841 [=========================>....] - ETA: 5s
157949952/175810841 [=========================>....] - ETA: 5s
158146560/175810841 [=========================>....] - ETA: 5s
158343168/175810841 [==========================>...] - ETA: 5s
158539776/175810841 [==========================>...] - ETA: 5s
158736384/175810841 [==========================>...] - ETA: 5s
158932992/175810841 [==========================>...] - ETA: 5s
159129600/175810841 [==========================>...] - ETA: 5s
159326208/175810841 [==========================>...] - ETA: 4s
159522816/175810841 [==========================>...] - ETA: 4s
159719424/175810841 [==========================>...] - ETA: 4s
159916032/175810841 [==========================>...] - ETA: 4s
160112640/175810841 [==========================>...] - ETA: 4s
160309248/175810841 [==========================>...] - ETA: 4s
160505856/175810841 [==========================>...] - ETA: 4s
160702464/175810841 [==========================>...] - ETA: 4s
160899072/175810841 [==========================>...] - ETA: 4s
161095680/175810841 [==========================>...] - ETA: 4s
161292288/175810841 [==========================>...] - ETA: 4s
161488896/175810841 [==========================>...] - ETA: 4s
161685504/175810841 [==========================>...] - ETA: 4s
161882112/175810841 [==========================>...] - ETA: 4s
162078720/175810841 [==========================>...] - ETA: 4s
162275328/175810841 [==========================>...] - ETA: 4s
162471936/175810841 [==========================>...] - ETA: 4s
162668544/175810841 [==========================>...] - ETA: 3s
162865152/175810841 [==========================>...] - ETA: 3s
163061760/175810841 [==========================>...] - ETA: 3s
163258368/175810841 [==========================>...] - ETA: 3s
163454976/175810841 [==========================>...] - ETA: 3s
163651584/175810841 [==========================>...] - ETA: 3s
163848192/175810841 [==========================>...] - ETA: 3s
164044800/175810841 [==========================>...] - ETA: 3s
164241408/175810841 [===========================>..] - ETA: 3s
164438016/175810841 [===========================>..] - ETA: 3s
164634624/175810841 [===========================>..] - ETA: 3s
164831232/175810841 [===========================>..] - ETA: 3s
165027840/175810841 [===========================>..] - ETA: 3s
165224448/175810841 [===========================>..] - ETA: 3s
165421056/175810841 [===========================>..] - ETA: 3s
165617664/175810841 [===========================>..] - ETA: 3s
165814272/175810841 [===========================>..] - ETA: 3s
166010880/175810841 [===========================>..] - ETA: 2s
166207488/175810841 [===========================>..] - ETA: 2s
166404096/175810841 [===========================>..] - ETA: 2s
166600704/175810841 [===========================>..] - ETA: 2s
166797312/175810841 [===========================>..] - ETA: 2s
166993920/175810841 [===========================>..] - ETA: 2s
167190528/175810841 [===========================>..] - ETA: 2s
167387136/175810841 [===========================>..] - ETA: 2s
167583744/175810841 [===========================>..] - ETA: 2s
167780352/175810841 [===========================>..] - ETA: 2s
167976960/175810841 [===========================>..] - ETA: 2s
168173568/175810841 [===========================>..] - ETA: 2s
168370176/175810841 [===========================>..] - ETA: 2s
168566784/175810841 [===========================>..] - ETA: 2s
168763392/175810841 [===========================>..] - ETA: 2s
168960000/175810841 [===========================>..] - ETA: 2s
169156608/175810841 [===========================>..] - ETA: 2s
169353216/175810841 [===========================>..] - ETA: 1s
169549824/175810841 [===========================>..] - ETA: 1s
169746432/175810841 [===========================>..] - ETA: 1s
169943040/175810841 [===========================>..] - ETA: 1s
170139648/175810841 [============================>.] - ETA: 1s
170336256/175810841 [============================>.] - ETA: 1s
170532864/175810841 [============================>.] - ETA: 1s
170729472/175810841 [============================>.] - ETA: 1s
170926080/175810841 [============================>.] - ETA: 1s
171122688/175810841 [============================>.] - ETA: 1s
171319296/175810841 [============================>.] - ETA: 1s
171515904/175810841 [============================>.] - ETA: 1s
171712512/175810841 [============================>.] - ETA: 1s
171909120/175810841 [============================>.] - ETA: 1s
172105728/175810841 [============================>.] - ETA: 1s
172302336/175810841 [============================>.] - ETA: 1s
172498944/175810841 [============================>.] - ETA: 1s
172695552/175810841 [============================>.] - ETA: 0s
172892160/175810841 [============================>.] - ETA: 0s
173088768/175810841 [============================>.] - ETA: 0s
173285376/175810841 [============================>.] - ETA: 0s
173481984/175810841 [============================>.] - ETA: 0s
173678592/175810841 [============================>.] - ETA: 0s
173875200/175810841 [============================>.] - ETA: 0s
174071808/175810841 [============================>.] - ETA: 0s
174268416/175810841 [============================>.] - ETA: 0s
174465024/175810841 [============================>.] - ETA: 0s
174661632/175810841 [============================>.] - ETA: 0s
174858240/175810841 [============================>.] - ETA: 0s
175054848/175810841 [============================>.] - ETA: 0s
175251456/175810841 [============================>.] - ETA: 0s
175448064/175810841 [============================>.] - ETA: 0s
175644672/175810841 [============================>.] - ETA: 0s
175816704/175810841 [==============================] - 53s 0us/step
Re-loading previously preprocessed dataset...

3. Create a Keras model satisfying Akida NSoC requirements

The model consists of:

  • a first Convolutional layer accepting dense inputs (images),

  • several Separable Convolutional layers preserving spatial dimensions,

  • a global pooling reducing the spatial dimensions to a single pixel,

  • a last Separable Convolutional layer to reduce the number of outputs to the number of words to predict.

All layers are followed by a batch normalization and a ReLU activation, except the last one that is followed by a SoftMax.

The first convolutional layer uses 8 bits weights, but other layers use 4 bits weights.

All activations are 4 bits.

Note

The reason why we do not use a simple FullyConnected layer as the last layer is precisely because of the 4 bits activations, that are only supported as inputs by the Separable Convolutional layers.

Pre-trained weights were obtained after three training episodes:

  • first, we train the model with unconstrained float weights and activations for 30 epochs,

  • then, we train the model with quantized activations only, with weights initialized from those trained in the previous episode,

  • finally, we train the model with quantized weights and activations, with weights initialized from those trained in the previous episode.

The table below summarizes the results obtained when preparing the weights stored under http://data.brainchip.com/models/ds_cnn/ :

Episode

Weights Quant.

Activ. Quant.

Accuracy

Epochs

1

N/A

N/A

91.98 %

30

2

N/A

4 bits

92.13 %

30

3

8/4 bits

4 bits

91.67 %

30

K.clear_session()
model_keras = ds_cnn_kws_pretrained()
model_keras.summary()

Out:

Downloading data from http://data.brainchip.com/models/ds_cnn/ds_cnn_kws_wq4_aq4.hdf5

  8192/172152 [>.............................] - ETA: 0s
 73728/172152 [===========>..................] - ETA: 0s
180224/172152 [===============================] - 0s 1us/step
Model: "ds_cnn_kws"
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
input_43 (InputLayer)        [(None, 49, 10, 1)]       0
_________________________________________________________________
conv_0 (QuantizedConv2D)     (None, 25, 5, 32)         800
_________________________________________________________________
conv_0_BN (BatchNormalizatio (None, 25, 5, 32)         128
_________________________________________________________________
conv_0_relu (ActivationDiscr (None, 25, 5, 32)         0
_________________________________________________________________
separable_1 (QuantizedSepara (None, 25, 5, 64)         2336
_________________________________________________________________
separable_1_BN (BatchNormali (None, 25, 5, 64)         256
_________________________________________________________________
separable_1_relu (Activation (None, 25, 5, 64)         0
_________________________________________________________________
separable_2 (QuantizedSepara (None, 25, 5, 64)         4672
_________________________________________________________________
separable_2_BN (BatchNormali (None, 25, 5, 64)         256
_________________________________________________________________
separable_2_relu (Activation (None, 25, 5, 64)         0
_________________________________________________________________
separable_3 (QuantizedSepara (None, 25, 5, 64)         4672
_________________________________________________________________
separable_3_BN (BatchNormali (None, 25, 5, 64)         256
_________________________________________________________________
separable_3_relu (Activation (None, 25, 5, 64)         0
_________________________________________________________________
separable_4 (QuantizedSepara (None, 25, 5, 64)         4672
_________________________________________________________________
separable_4_BN (BatchNormali (None, 25, 5, 64)         256
_________________________________________________________________
separable_4_relu (Activation (None, 25, 5, 64)         0
_________________________________________________________________
separable_5 (QuantizedSepara (None, 25, 5, 64)         4672
_________________________________________________________________
separable_5_global_avg (Glob (None, 64)                0
_________________________________________________________________
separable_5_BN (BatchNormali (None, 64)                256
_________________________________________________________________
separable_5_relu (Activation (None, 64)                0
_________________________________________________________________
reshape_1 (Reshape)          (None, 1, 1, 64)          0
_________________________________________________________________
separable_6 (QuantizedSepara (None, 1, 1, 12)          1344
_________________________________________________________________
act_softmax (Activation)     (None, 1, 1, 12)          0
_________________________________________________________________
reshape_2 (Reshape)          (None, 12)                0
=================================================================
Total params: 24,576
Trainable params: 23,872
Non-trainable params: 704
_________________________________________________________________

4. Check performance

# Check Model performance
potentials_keras = model_keras.predict(x_valid_rescaled_cnn)
preds_keras = np.squeeze(np.argmax(potentials_keras, 1))

accuracy = accuracy_score(y_valid, preds_keras)
print("Accuracy: " + "{0:.2f}".format(100 * accuracy) + "%")

Out:

Accuracy: 91.62%

5. Conversion to Akida

5.1 Convert the trained Keras model to Akida

We convert the model to Akida and verify that it is compatible with the Akida NSoC (HW column in summary).

# Convert the model
from cnn2snn import convert

model_akida = convert(model_keras, input_scaling=input_scaling)
model_akida.summary()

Out:

Warning: the activation layer 'act_softmax' will be discarded at conversion. The outputs of the Akida model will be the potentials before this activation layer.
                                   Model Summary
___________________________________________________________________________________
Layer (type)                          Output shape  Kernel shape
===================================================================================
conv_0 (InputConvolutional)           [5, 25, 32]   (5, 5, 1, 32)
___________________________________________________________________________________
separable_1 (SeparableConvolutional)  [5, 25, 64]   (3, 3, 32, 1), (1, 1, 32, 64)
___________________________________________________________________________________
separable_2 (SeparableConvolutional)  [5, 25, 64]   (3, 3, 64, 1), (1, 1, 64, 64)
___________________________________________________________________________________
separable_3 (SeparableConvolutional)  [5, 25, 64]   (3, 3, 64, 1), (1, 1, 64, 64)
___________________________________________________________________________________
separable_4 (SeparableConvolutional)  [5, 25, 64]   (3, 3, 64, 1), (1, 1, 64, 64)
___________________________________________________________________________________
separable_5 (SeparableConvolutional)  [1, 1, 64]    (3, 3, 64, 1), (1, 1, 64, 64)
___________________________________________________________________________________
separable_6 (SeparableConvolutional)  [1, 1, 12]    (3, 3, 64, 1), (1, 1, 64, 12)
___________________________________________________________________________________
Input shape: 49, 10, 1
Backend type: Software - 1.8.7

5.2 Check prediction accuracy

preds_akida = model_akida.predict(x_valid_akida, num_classes=CLASSES)

accuracy = accuracy_score(y_valid, preds_akida)
print("Accuracy: " + "{0:.2f}".format(100 * accuracy) + "%")

# For non-regression purpose
assert accuracy > 0.83

# Print model statistics
print("Model statistics")
stats = model_akida.get_statistics()
model_akida.predict(x_valid_akida[:20], num_classes=CLASSES)
for _, stat in stats.items():
    print(stat)

Out:

Accuracy: 91.60%
Model statistics
Layer (type)                  output sparsity
conv_0 (InputConvolutional)   0.47
Layer (type)                  input sparsity      output sparsity     ops
separable_1 (SeparableConvolu 0.47                0.55                1240873
Layer (type)                  input sparsity      output sparsity     ops
separable_2 (SeparableConvolu 0.55                0.59                2127616
Layer (type)                  input sparsity      output sparsity     ops
separable_3 (SeparableConvolu 0.59                0.64                1918741
Layer (type)                  input sparsity      output sparsity     ops
separable_4 (SeparableConvolu 0.64                0.67                1705860
Layer (type)                  input sparsity      output sparsity     ops
separable_5 (SeparableConvolu 0.67                0.46                1556217
Layer (type)                  input sparsity      output sparsity     ops
separable_6 (SeparableConvolu 0.46                0.00                4066

5.3 Confusion matrix

The confusion matrix provides a good summary of what mistakes the network is making.

Per scikit-learn convention it displays the true class in each row (ie on each row you can see what the network predicted for the corresponding word).

Please refer to the Tensorflow audio recognition example for a detailed explaination of the confusion matrix.

# Create confusion matrix
label_mapping = dict(zip(all_words, range(len(all_words))))

cm = confusion_matrix(y_valid, preds_akida, list(label_mapping.values()))

# Normalize
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]

# Display confusion matrix
plt.rcParams["figure.figsize"] = (8, 8)
plt.figure()

classes = label_mapping
title = 'Confusion matrix'
cmap = plt.cm.Blues

plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title)
plt.colorbar()
tick_marks = np.arange(len(classes))
plt.xticks(tick_marks, classes, rotation=45)
plt.yticks(tick_marks, classes)

thresh = cm.max() / 2.
for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):
    plt.text(j,
             i,
             format(cm[i, j], '.2f'),
             horizontalalignment="center",
             color="white" if cm[i, j] > thresh else "black")

plt.ylabel('True label')
plt.xlabel('Predicted label')
plt.autoscale()
plt.show()
../_images/sphx_glr_plot_ds_cnn_kws_001.png

Out:

/usr/local/lib/python3.7/site-packages/sklearn/utils/validation.py:71: FutureWarning: Pass labels=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] as keyword args. From version 0.25 passing these as positional arguments will result in an error
  FutureWarning)

Total running time of the script: ( 0 minutes 55.952 seconds)

Gallery generated by Sphinx-Gallery