from collections import defaultdict import datetime from keras.callbacks import EarlyStopping, ModelCheckpoint from keras.layers import Activation, Concatenate, Conv2D, Dense, Dropout, Flatten, MaxPooling2D from keras.models import Input, Model, load_model, model_from_json from librosa import cqt import numpy as np import os import pickle import shutil from sklearn.base import BaseEstimator, TransformerMixin from sklearn.metrics import accuracy_score, classification_report, f1_score, precision_score, recall_score from sklearn.model_selection import KFold, StratifiedKFold from sklearn.preprocessing import StandardScaler import sys from warnings import warn from zipfile import ZipFile module_path = os.path.abspath('..') if module_path not in sys.path: sys.path.append(module_path) from music_transcription.pitch_detection.cnn_cqt_pitch_detection import CnnCqtFeatureExtractor from music_transcription.pitch_detection.read_data import get_wav_and_truth_files, read_data_y

In [2]:
DATASETS_CV = {1, 2}
DATASETS_ADDITIONAL = {3, 9, 10, 11}

sample_rate = 44100
subsampling_step = 1
min_pitch = 40
max_pitch = 88
onset_group_threshold_seconds = 0.05

image_data_format = 'channels_first'
cqt_configs = [
    {
        'hop_length': 512,
        'fmin': 55.0,
        'n_bins': 180,
        'bins_per_octave': 36,
        'scale': False,
    },
]
n_frames_before = 15
n_frames_after = 20

LOSS = 'binary_crossentropy'
OPTIMIZER = 'adam'
METRICS = None
BATCH_SIZE = 256

In [3]:
wav_file_paths_cv, truth_dataset_format_tuples_cv = get_wav_and_truth_files(DATASETS_CV)
wav_file_paths_additional, truth_dataset_format_tuples_additional = get_wav_and_truth_files(DATASETS_ADDITIONAL)


C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping AR_Lick11_FN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping AR_Lick11_KN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping AR_Lick11_MN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:135: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\audio\desktop.ini, not a .wav file.
  warn('Skipping ' + path_to_wav + ', not a .wav file.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping FS_Lick11_FN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping FS_Lick11_KN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping FS_Lick11_MN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping LP_Lick11_FN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping LP_Lick11_KN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping LP_Lick11_MN.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping G63-44104-1111-20675.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping G71-40100-1111-20749.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping G83-45105-1111-20988.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping G91-43103-1111-21064.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping G93-46106-1111-21145.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping P94-43120-1111-41410.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')
C:\Users\Michel\FH\IP6\git\music_transcription\onset_detection\read_data.py:133: UserWarning: Skipping P94-44110-1111-41396.wav, no truth found.
  warn('Skipping ' + wav_file + ', no truth found.')

In [4]:
folds = []
k_fold = KFold(n_splits=5, shuffle=True, random_state=42)
for k, (train_indices, test_indices) in enumerate(k_fold.split(wav_file_paths_cv)):
    if k > 0:
        print('Skipping split {}'.format(k))
        continue
    
    wav_file_paths_train = [wav_file_paths_cv[i] for i in train_indices] + wav_file_paths_additional
    truth_dataset_format_tuples_train = [truth_dataset_format_tuples_cv[i] for i in train_indices] + truth_dataset_format_tuples_additional
    wav_file_paths_test = [wav_file_paths_cv[i] for i in test_indices]
    truth_dataset_format_tuples_test = [truth_dataset_format_tuples_cv[i] for i in test_indices]
    
    data_train, y_train, wav_file_paths_train_valid, truth_dataset_format_tuples_train_valid = read_data_y(
        wav_file_paths_train, truth_dataset_format_tuples_train,
        sample_rate, subsampling_step,
        min_pitch, max_pitch,
        onset_group_threshold_seconds=onset_group_threshold_seconds
    )
    
    feature_extractor = CnnCqtFeatureExtractor(image_data_format, sample_rate, cqt_configs, n_frames_before, n_frames_after)
    list_of_X_train, sample_file_indexes_train = feature_extractor.fit_transform(data_train)

    data_test, y_test, wav_file_paths_test_valid, truth_dataset_format_tuples_test_valid = read_data_y(
        wav_file_paths_test, truth_dataset_format_tuples_test,
        sample_rate, subsampling_step,
        min_pitch, max_pitch,
        onset_group_threshold_seconds=onset_group_threshold_seconds
    )
    list_of_X_test, sample_file_indexes_test = feature_extractor.transform(data_test, verbose=True)

    folds.append((list_of_X_train, y_train, list_of_X_test, y_test))


C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\annotation\AR_NH_IV.xml, pitch 92 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\annotation\AR_NH_IX.xml, pitch 92 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\annotation\FS_NH_IV.xml, pitch 92 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\annotation\FS_NH_IX.xml, pitch 92 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\annotation\LP_NH_IV.xml, pitch 92 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:56: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset3\audio\pathetique_poly.wav, cannot handle stereo signal.
  warn('Skipping ' + path_to_wav + ', cannot handle stereo signal.')
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset3\annotation\pathetique_poly.xml, pitch 30 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
Creating spectrograms
Fitting standard scalers for each spectrogram and bin
(515965, 180)
3.63677319949
22.0932928692
Standardizing for each spectrogram and bin
-2.02342757837e-16
1.0
(4466, 36, 180)
Reshaping data
(4466, 1, 36, 180)
C:\Users\Michel\FH\IP6\git\music_transcription\pitch_detection\read_data.py:90: UserWarning: Skipping ..\data\IDMT-SMT-GUITAR_V2\dataset2\annotation\LP_NH_IX.xml, pitch 92 is out of range.
  warn('Skipping {}, pitch {} is out of range.'.format(path_to_xml, pitch))
Creating spectrograms
(73188, 180)
5.06737530463
27.5702815749
Standardizing for each spectrogram and bin
0.0824521316465
1.19121556558
(633, 36, 180)
Reshaping data
(633, 1, 36, 180)
Skipping split 1
Skipping split 2
Skipping split 3
Skipping split 4

In [8]:
def predict(model, proba_threshold, list_of_X, y, epsilon=1e-7):
    proba_matrix = model.predict(list_of_X)
    y = proba_matrix > proba_threshold
    y = y.astype(np.int8)

    # Make sure at least one pitch is returned.
    for probas, labels in zip(proba_matrix, y):
        if labels.sum() == 0:
            max_proba = max(probas)
            max_index = np.where(np.logical_and(probas > max_proba - epsilon, probas < max_proba + epsilon))[0][0]
            labels[max_index] = 1

    return y

def print_metrics(y, y_predicted):
    accuracy = round(accuracy_score(y, y_predicted), 4)
    print('Accuracy: {}'.format(accuracy))
    print(classification_report(y, y_predicted, digits=3,
                                target_names=[str(pitch) for pitch in range(min_pitch, max_pitch + 1)]))
    
    return accuracy

In [6]:
def create_model_11(list_of_X, n_output_units,
                    dropout_conv=None, dropout_dense=None,
                    n_filters=None, filter_size=None, pool_size=None):
    inputs = []
    conv_blocks = []
    for X in list_of_X:
        spectrogram = Input(shape=X.shape[1:])
        inputs.append(spectrogram)

        conv = Conv2D(10, (10, 3), padding='valid')(spectrogram)
        conv = Activation('relu')(conv)
        conv = MaxPooling2D(pool_size=(6, 3))(conv)
        conv = Dropout(0.15)(conv)
        conv = Flatten()(conv)
        conv_blocks.append(conv)

        conv = Conv2D(512, (10, 180), strides=(5, 1), padding='valid')(spectrogram)
        conv = Activation('relu')(conv)
        conv = MaxPooling2D(pool_size=(2, 1))(conv)
        conv = Dropout(0.25)(conv)
        conv = Flatten()(conv)
        conv_blocks.append(conv)

    z = Concatenate()(conv_blocks)
    z = Dense(256)(z)
    z = Activation('relu')(z)
    z = Dropout(0.3)(z)
    output = Dense(n_output_units, activation='sigmoid')(z)

    model = Model(inputs, output)
    model.compile(loss=LOSS, optimizer=OPTIMIZER, metrics=METRICS)
    model.summary()

    return model

In [9]:
list_of_X_train, y_train, list_of_X_test, y_test = folds[0]
n = 10
sample_counts = []
scores = []
for i in range(1, n + 1):
    list_of_X_train_i = []
    for X in list_of_X_train:
        limit = int(X.shape[0] * i / n)
        X_cut = X[:limit, :, :, :]
        list_of_X_train_i.append(X_cut)
    y_train_i = y_train[:limit, :]
    
    model = create_model_11(list_of_X_train_i, max_pitch - min_pitch + 1)
    model.fit(list_of_X_train_i, y_train_i,
              epochs=1000,
              batch_size=BATCH_SIZE,
              sample_weight=None,
              class_weight=None,
              callbacks=[EarlyStopping(monitor='loss', patience=6)],
              verbose=0)

    y_test_predicted = predict(model, 0.5, list_of_X_test, y_test)
    accuracy = print_metrics(y_test, y_test_predicted)
    
    sample_counts.append(limit)
    scores.append(accuracy)


____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_1 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_1 (Conv2D)                (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_2 (Conv2D)                (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_1 (Activation)        (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_2 (Activation)        (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_1 (MaxPooling2D)   (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_2 (MaxPooling2D)   (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_1 (Dropout)              (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_2 (Dropout)              (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_1 (Flatten)              (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_2 (Flatten)              (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_1 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_1 (Dense)                  (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_3 (Activation)        (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_3 (Dropout)              (None, 256)           0                                            
____________________________________________________________________________________________________
dense_2 (Dense)                  (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.7725
             precision    recall  f1-score   support

         40      1.000     0.769     0.870        13
         41      0.600     1.000     0.750         3
         42      1.000     1.000     1.000         2
         43      0.833     1.000     0.909         5
         44      1.000     1.000     1.000         4
         45      0.900     0.931     0.915        29
         46      1.000     1.000     1.000         3
         47      1.000     0.667     0.800        21
         48      0.962     0.864     0.911        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      0.833     0.833     0.833         6
         52      0.975     0.750     0.848        52
         53      0.824     0.737     0.778        19
         54      0.967     0.906     0.935        32
         55      0.969     0.689     0.805        45
         56      1.000     0.895     0.944        38
         57      0.938     0.667     0.779        45
         58      0.286     0.800     0.421         5
         59      0.957     0.616     0.750        73
         60      0.886     0.795     0.838        39
         61      0.966     0.609     0.747        46
         62      0.696     0.711     0.703        45
         63      0.389     0.875     0.538         8
         64      0.930     0.841     0.883        63
         65      0.929     0.867     0.897        15
         66      0.909     0.714     0.800        14
         67      0.533     0.889     0.667        18
         68      1.000     0.625     0.769         8
         69      0.872     0.872     0.872        39
         70      1.000     0.833     0.909         6
         71      0.333     0.600     0.429         5
         72      0.875     0.700     0.778        10
         73      0.250     0.250     0.250         4
         74      0.769     0.833     0.800        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      0.333     1.000     0.500         2
         79      1.000     0.333     0.500         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      0.000     0.000     0.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      0.000     0.000     0.000         2

avg / total      0.900     0.782     0.826       862

D:\ProgramFiles\Anaconda3_64\lib\site-packages\sklearn\metrics\classification.py:1113: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.
  'precision', 'predicted', average, warn_for)
D:\ProgramFiles\Anaconda3_64\lib\site-packages\sklearn\metrics\classification.py:1115: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples.
  'recall', 'true', average, warn_for)
____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_2 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_3 (Conv2D)                (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_4 (Conv2D)                (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_4 (Activation)        (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_5 (Activation)        (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_3 (MaxPooling2D)   (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_4 (MaxPooling2D)   (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_4 (Dropout)              (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_5 (Dropout)              (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_3 (Flatten)              (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_4 (Flatten)              (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_2 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_3 (Dense)                  (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_6 (Activation)        (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_6 (Dropout)              (None, 256)           0                                            
____________________________________________________________________________________________________
dense_4 (Dense)                  (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.8784
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      0.625     1.000     0.769         5
         44      1.000     1.000     1.000         4
         45      0.935     1.000     0.967        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.667     0.800         6
         52      1.000     0.942     0.970        52
         53      0.864     1.000     0.927        19
         54      1.000     0.969     0.984        32
         55      0.956     0.956     0.956        45
         56      1.000     0.921     0.959        38
         57      0.977     0.933     0.955        45
         58      0.667     0.800     0.727         5
         59      0.985     0.890     0.935        73
         60      1.000     0.846     0.917        39
         61      1.000     0.739     0.850        46
         62      0.780     0.711     0.744        45
         63      0.800     1.000     0.889         8
         64      0.894     0.937     0.915        63
         65      0.929     0.867     0.897        15
         66      0.929     0.929     0.929        14
         67      0.727     0.889     0.800        18
         68      1.000     0.875     0.933         8
         69      0.947     0.923     0.935        39
         70      1.000     0.833     0.909         6
         71      1.000     0.600     0.750         5
         72      1.000     0.800     0.889        10
         73      1.000     0.500     0.667         4
         74      1.000     0.750     0.857        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     0.500     0.667         2
         79      1.000     0.333     0.500         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      0.000     0.000     0.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      0.000     0.000     0.000         2

avg / total      0.949     0.901     0.920       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_3 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_5 (Conv2D)                (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_6 (Conv2D)                (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_7 (Activation)        (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_8 (Activation)        (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_5 (MaxPooling2D)   (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_6 (MaxPooling2D)   (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_7 (Dropout)              (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_8 (Dropout)              (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_5 (Flatten)              (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_6 (Flatten)              (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_3 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_5 (Dense)                  (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_9 (Activation)        (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_9 (Dropout)              (None, 256)           0                                            
____________________________________________________________________________________________________
dense_6 (Dense)                  (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9289
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      0.600     1.000     0.750         3
         42      1.000     1.000     1.000         2
         43      0.714     1.000     0.833         5
         44      1.000     1.000     1.000         4
         45      0.967     1.000     0.983        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.667     0.800         6
         52      0.981     1.000     0.990        52
         53      0.905     1.000     0.950        19
         54      1.000     0.938     0.968        32
         55      0.976     0.911     0.943        45
         56      1.000     0.974     0.987        38
         57      0.978     0.978     0.978        45
         58      0.800     0.800     0.800         5
         59      0.946     0.959     0.952        73
         60      1.000     0.846     0.917        39
         61      1.000     0.935     0.966        46
         62      0.896     0.956     0.925        45
         63      1.000     0.875     0.933         8
         64      0.951     0.921     0.935        63
         65      1.000     1.000     1.000        15
         66      1.000     0.929     0.963        14
         67      0.778     0.778     0.778        18
         68      1.000     0.875     0.933         8
         69      0.950     0.974     0.962        39
         70      0.833     0.833     0.833         6
         71      1.000     0.600     0.750         5
         72      1.000     0.700     0.824        10
         73      1.000     0.500     0.667         4
         74      1.000     0.833     0.909        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     0.500     0.667         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      0.000     0.000     0.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      0.000     0.000     0.000         2

avg / total      0.962     0.937     0.947       862

D:\ProgramFiles\Anaconda3_64\lib\site-packages\sklearn\metrics\classification.py:1113: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.
  'precision', 'predicted', average, warn_for)
D:\ProgramFiles\Anaconda3_64\lib\site-packages\sklearn\metrics\classification.py:1115: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples.
  'recall', 'true', average, warn_for)
____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_4 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_7 (Conv2D)                (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_8 (Conv2D)                (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_10 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_11 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_7 (MaxPooling2D)   (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_8 (MaxPooling2D)   (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_10 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_11 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_7 (Flatten)              (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_8 (Flatten)              (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_4 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_7 (Dense)                  (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_12 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_12 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_8 (Dense)                  (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9273
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      0.750     1.000     0.857         3
         42      1.000     1.000     1.000         2
         43      0.833     1.000     0.909         5
         44      1.000     1.000     1.000         4
         45      0.967     1.000     0.983        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     0.983     0.991        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.833     0.909         6
         52      0.981     1.000     0.990        52
         53      0.950     1.000     0.974        19
         54      1.000     0.969     0.984        32
         55      0.978     0.978     0.978        45
         56      1.000     1.000     1.000        38
         57      0.978     0.978     0.978        45
         58      1.000     0.800     0.889         5
         59      0.986     0.945     0.965        73
         60      1.000     0.897     0.946        39
         61      1.000     0.891     0.943        46
         62      0.875     0.933     0.903        45
         63      1.000     0.875     0.933         8
         64      0.952     0.937     0.944        63
         65      1.000     0.800     0.889        15
         66      1.000     0.929     0.963        14
         67      0.842     0.889     0.865        18
         68      1.000     0.750     0.857         8
         69      0.950     0.974     0.962        39
         70      0.833     0.833     0.833         6
         71      1.000     0.600     0.750         5
         72      1.000     0.700     0.824        10
         73      1.000     0.500     0.667         4
         74      1.000     0.750     0.857        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      0.333     0.500     0.400         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     0.333     0.500         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      0.000     0.000     0.000         2

avg / total      0.971     0.940     0.952       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_5 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_9 (Conv2D)                (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_10 (Conv2D)               (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_13 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_14 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_9 (MaxPooling2D)   (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_10 (MaxPooling2D)  (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_13 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_14 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_9 (Flatten)              (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_10 (Flatten)             (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_5 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_9 (Dense)                  (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_15 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_15 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_10 (Dense)                 (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.94
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      0.714     1.000     0.833         5
         44      1.000     1.000     1.000         4
         45      0.935     1.000     0.967        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.833     0.909         6
         52      1.000     1.000     1.000        52
         53      0.947     0.947     0.947        19
         54      1.000     0.938     0.968        32
         55      0.977     0.956     0.966        45
         56      1.000     1.000     1.000        38
         57      0.978     0.978     0.978        45
         58      1.000     0.800     0.889         5
         59      0.973     0.986     0.980        73
         60      1.000     0.846     0.917        39
         61      1.000     0.935     0.966        46
         62      0.911     0.911     0.911        45
         63      1.000     0.875     0.933         8
         64      0.968     0.952     0.960        63
         65      1.000     0.933     0.966        15
         66      1.000     1.000     1.000        14
         67      0.789     0.833     0.811        18
         68      1.000     0.875     0.933         8
         69      0.927     0.974     0.950        39
         70      0.833     0.833     0.833         6
         71      1.000     0.600     0.750         5
         72      1.000     0.700     0.824        10
         73      1.000     0.250     0.400         4
         74      1.000     0.833     0.909        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     1.000     1.000         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     0.333     0.500         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      0.000     0.000     0.000         2

avg / total      0.972     0.945     0.956       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_6 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_11 (Conv2D)               (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_12 (Conv2D)               (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_16 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_17 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_11 (MaxPooling2D)  (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_12 (MaxPooling2D)  (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_16 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_17 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_11 (Flatten)             (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_12 (Flatten)             (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_6 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_11 (Dense)                 (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_18 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_18 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_12 (Dense)                 (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9494
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      0.714     1.000     0.833         5
         44      1.000     1.000     1.000         4
         45      1.000     1.000     1.000        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.833     0.909         6
         52      1.000     1.000     1.000        52
         53      0.905     1.000     0.950        19
         54      1.000     0.969     0.984        32
         55      0.977     0.956     0.966        45
         56      1.000     1.000     1.000        38
         57      0.977     0.956     0.966        45
         58      1.000     0.800     0.889         5
         59      1.000     0.986     0.993        73
         60      0.946     0.897     0.921        39
         61      1.000     0.935     0.966        46
         62      0.894     0.933     0.913        45
         63      1.000     0.875     0.933         8
         64      1.000     0.968     0.984        63
         65      1.000     1.000     1.000        15
         66      1.000     1.000     1.000        14
         67      0.810     0.944     0.872        18
         68      1.000     0.625     0.769         8
         69      1.000     0.974     0.987        39
         70      1.000     0.833     0.909         6
         71      1.000     0.600     0.750         5
         72      1.000     0.800     0.889        10
         73      1.000     0.500     0.667         4
         74      1.000     0.917     0.957        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     1.000     1.000         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     1.000     1.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      1.000     1.000     1.000         2

avg / total      0.982     0.961     0.969       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_7 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_13 (Conv2D)               (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_14 (Conv2D)               (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_19 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_20 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_13 (MaxPooling2D)  (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_14 (MaxPooling2D)  (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_19 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_20 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_13 (Flatten)             (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_14 (Flatten)             (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_7 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_13 (Dense)                 (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_21 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_21 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_14 (Dense)                 (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9542
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      0.714     1.000     0.833         5
         44      1.000     1.000     1.000         4
         45      1.000     1.000     1.000        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.667     0.800         6
         52      1.000     1.000     1.000        52
         53      0.950     1.000     0.974        19
         54      1.000     0.969     0.984        32
         55      1.000     1.000     1.000        45
         56      1.000     0.974     0.987        38
         57      0.978     0.978     0.978        45
         58      1.000     0.800     0.889         5
         59      1.000     0.959     0.979        73
         60      1.000     0.846     0.917        39
         61      1.000     0.935     0.966        46
         62      0.915     0.956     0.935        45
         63      1.000     0.750     0.857         8
         64      1.000     0.984     0.992        63
         65      1.000     1.000     1.000        15
         66      1.000     0.929     0.963        14
         67      0.842     0.889     0.865        18
         68      1.000     0.875     0.933         8
         69      0.974     0.974     0.974        39
         70      0.833     0.833     0.833         6
         71      1.000     0.800     0.889         5
         72      1.000     0.800     0.889        10
         73      1.000     0.250     0.400         4
         74      1.000     0.833     0.909        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     1.000     1.000         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     1.000     1.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      1.000     0.500     0.667         2

avg / total      0.986     0.956     0.968       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_8 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_15 (Conv2D)               (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_16 (Conv2D)               (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_22 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_23 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_15 (MaxPooling2D)  (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_16 (MaxPooling2D)  (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_22 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_23 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_15 (Flatten)             (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_16 (Flatten)             (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_8 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_15 (Dense)                 (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_24 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_24 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_16 (Dense)                 (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9494
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      1.000     0.800     0.889         5
         44      1.000     1.000     1.000         4
         45      1.000     1.000     1.000        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.833     0.909         6
         52      1.000     1.000     1.000        52
         53      0.895     0.895     0.895        19
         54      1.000     0.938     0.968        32
         55      0.978     0.978     0.978        45
         56      1.000     0.974     0.987        38
         57      0.978     0.978     0.978        45
         58      1.000     0.800     0.889         5
         59      0.986     1.000     0.993        73
         60      0.972     0.897     0.933        39
         61      1.000     0.891     0.943        46
         62      0.933     0.933     0.933        45
         63      1.000     0.750     0.857         8
         64      0.954     0.984     0.969        63
         65      1.000     0.867     0.929        15
         66      1.000     0.929     0.963        14
         67      0.875     0.778     0.824        18
         68      1.000     0.875     0.933         8
         69      1.000     0.974     0.987        39
         70      0.833     0.833     0.833         6
         71      1.000     0.600     0.750         5
         72      1.000     0.700     0.824        10
         73      1.000     0.500     0.667         4
         74      1.000     1.000     1.000        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     1.000     1.000         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     1.000     1.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      1.000     1.000     1.000         2

avg / total      0.982     0.951     0.965       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_9 (InputLayer)             (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_17 (Conv2D)               (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_18 (Conv2D)               (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_25 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_26 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_17 (MaxPooling2D)  (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_18 (MaxPooling2D)  (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_25 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_26 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_17 (Flatten)             (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_18 (Flatten)             (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_9 (Concatenate)      (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_17 (Dense)                 (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_27 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_27 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_18 (Dense)                 (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9526
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      0.714     1.000     0.833         5
         44      1.000     1.000     1.000         4
         45      1.000     1.000     1.000        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     0.983     0.991        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.667     0.800         6
         52      1.000     1.000     1.000        52
         53      0.900     0.947     0.923        19
         54      1.000     0.969     0.984        32
         55      0.978     1.000     0.989        45
         56      1.000     0.974     0.987        38
         57      0.978     0.978     0.978        45
         58      1.000     0.800     0.889         5
         59      1.000     0.986     0.993        73
         60      1.000     0.872     0.932        39
         61      1.000     0.935     0.966        46
         62      0.913     0.933     0.923        45
         63      1.000     0.750     0.857         8
         64      1.000     0.968     0.984        63
         65      0.933     0.933     0.933        15
         66      1.000     1.000     1.000        14
         67      0.933     0.778     0.848        18
         68      1.000     0.625     0.769         8
         69      1.000     0.974     0.987        39
         70      0.833     0.833     0.833         6
         71      1.000     0.600     0.750         5
         72      1.000     0.800     0.889        10
         73      1.000     0.500     0.667         4
         74      1.000     0.917     0.957        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     1.000     1.000         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     1.000     1.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      1.000     1.000     1.000         2

avg / total      0.986     0.952     0.967       862

____________________________________________________________________________________________________
Layer (type)                     Output Shape          Param #     Connected to                     
====================================================================================================
input_10 (InputLayer)            (None, 1, 36, 180)    0                                            
____________________________________________________________________________________________________
conv2d_19 (Conv2D)               (None, 10, 27, 178)   310                                          
____________________________________________________________________________________________________
conv2d_20 (Conv2D)               (None, 512, 6, 1)     922112                                       
____________________________________________________________________________________________________
activation_28 (Activation)       (None, 10, 27, 178)   0                                            
____________________________________________________________________________________________________
activation_29 (Activation)       (None, 512, 6, 1)     0                                            
____________________________________________________________________________________________________
max_pooling2d_19 (MaxPooling2D)  (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
max_pooling2d_20 (MaxPooling2D)  (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
dropout_28 (Dropout)             (None, 10, 4, 59)     0                                            
____________________________________________________________________________________________________
dropout_29 (Dropout)             (None, 512, 3, 1)     0                                            
____________________________________________________________________________________________________
flatten_19 (Flatten)             (None, 2360)          0                                            
____________________________________________________________________________________________________
flatten_20 (Flatten)             (None, 1536)          0                                            
____________________________________________________________________________________________________
concatenate_10 (Concatenate)     (None, 3896)          0                                            
____________________________________________________________________________________________________
dense_19 (Dense)                 (None, 256)           997632                                       
____________________________________________________________________________________________________
activation_30 (Activation)       (None, 256)           0                                            
____________________________________________________________________________________________________
dropout_30 (Dropout)             (None, 256)           0                                            
____________________________________________________________________________________________________
dense_20 (Dense)                 (None, 49)            12593                                        
====================================================================================================
Total params: 1,932,647.0
Trainable params: 1,932,647.0
Non-trainable params: 0.0
____________________________________________________________________________________________________
Accuracy: 0.9479
             precision    recall  f1-score   support

         40      1.000     1.000     1.000        13
         41      1.000     1.000     1.000         3
         42      1.000     1.000     1.000         2
         43      0.714     1.000     0.833         5
         44      1.000     1.000     1.000         4
         45      1.000     1.000     1.000        29
         46      1.000     1.000     1.000         3
         47      1.000     1.000     1.000        21
         48      1.000     1.000     1.000        59
         49      1.000     1.000     1.000        15
         50      1.000     1.000     1.000        43
         51      1.000     0.667     0.800         6
         52      1.000     1.000     1.000        52
         53      0.864     1.000     0.927        19
         54      1.000     0.969     0.984        32
         55      0.977     0.956     0.966        45
         56      1.000     0.921     0.959        38
         57      0.978     0.978     0.978        45
         58      1.000     0.800     0.889         5
         59      1.000     0.973     0.986        73
         60      1.000     0.872     0.932        39
         61      1.000     0.957     0.978        46
         62      0.932     0.911     0.921        45
         63      1.000     0.750     0.857         8
         64      0.983     0.937     0.959        63
         65      0.933     0.933     0.933        15
         66      1.000     1.000     1.000        14
         67      0.938     0.833     0.882        18
         68      1.000     0.625     0.769         8
         69      1.000     0.949     0.974        39
         70      0.833     0.833     0.833         6
         71      1.000     0.600     0.750         5
         72      1.000     0.800     0.889        10
         73      1.000     0.750     0.857         4
         74      1.000     0.833     0.909        12
         75      1.000     1.000     1.000         3
         76      1.000     1.000     1.000         4
         77      1.000     1.000     1.000         1
         78      1.000     1.000     1.000         2
         79      1.000     1.000     1.000         3
         80      0.000     0.000     0.000         0
         81      0.000     0.000     0.000         0
         82      0.000     0.000     0.000         0
         83      1.000     1.000     1.000         3
         84      0.000     0.000     0.000         0
         85      0.000     0.000     0.000         0
         86      0.000     0.000     0.000         0
         87      0.000     0.000     0.000         0
         88      1.000     1.000     1.000         2

avg / total      0.985     0.947     0.963       862


In [10]:
from matplotlib import pyplot as plt
%matplotlib inline

_ = plt.plot(sample_counts, scores)


Out[10]:
[<matplotlib.lines.Line2D at 0x1f61f6f5240>]