DETECTION OF TUBERS WITH CONVOLUTIONAL NEURAL NETWORKS

VISUALIZATION III

Import packages and functions

In [1]:
# Import packages
%matplotlib inline
from PIL import Image
import numpy as np
import os
from skimage.color import gray2rgb
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
!pip install tensorflow
!pip install keras
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, GaussianNoise, BatchNormalization, GlobalAveragePooling2D
from keras.layers import Conv2D, MaxPooling2D
from keras import Sequential
from keras.optimizers import Adam
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
from keras.preprocessing import image
from keras.models import Model
from keras import backend as K
from sklearn.metrics import confusion_matrix
!pip install git+https://github.com/raghakot/keras-vis.git --upgrade
from vis.visualization import visualize_cam, visualize_saliency, overlay
from keras import activations
from matplotlib import pyplot as plt
import matplotlib.cm as cm
import zipfile
from keras.models import model_from_json
import matplotlib as mpl
Requirement already satisfied: tensorflow in c:\programdata\anaconda3\lib\site-packages (1.12.0)
Requirement already satisfied: grpcio>=1.8.6 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.18.0)
Requirement already satisfied: six>=1.10.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.11.0)
Requirement already satisfied: termcolor>=1.1.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: numpy>=1.13.3 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.14.3)
Requirement already satisfied: wheel>=0.26 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.32.3)
Requirement already satisfied: absl-py>=0.1.6 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.7.0)
Requirement already satisfied: gast>=0.2.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.2.2)
Requirement already satisfied: astor>=0.6.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.7.1)
Requirement already satisfied: protobuf>=3.6.1 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.6.1)
Requirement already satisfied: keras-preprocessing>=1.0.5 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.0.5)
Requirement already satisfied: tensorboard<1.13.0,>=1.12.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.12.2)
Requirement already satisfied: keras-applications>=1.0.6 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.0.6)
Requirement already satisfied: setuptools in c:\programdata\anaconda3\lib\site-packages (from protobuf>=3.6.1->tensorflow) (40.6.3)
Requirement already satisfied: markdown>=2.6.8 in c:\programdata\anaconda3\lib\site-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow) (3.0.1)
Requirement already satisfied: werkzeug>=0.11.10 in c:\programdata\anaconda3\lib\site-packages (from tensorboard<1.13.0,>=1.12.0->tensorflow) (0.14.1)
Requirement already satisfied: h5py in c:\programdata\anaconda3\lib\site-packages (from keras-applications>=1.0.6->tensorflow) (2.7.1)
You are using pip version 19.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Requirement already satisfied: keras in c:\programdata\anaconda3\lib\site-packages (2.2.4)
Requirement already satisfied: numpy>=1.9.1 in c:\programdata\anaconda3\lib\site-packages (from keras) (1.14.3)
Requirement already satisfied: scipy>=0.14 in c:\programdata\anaconda3\lib\site-packages (from keras) (1.1.0)
Requirement already satisfied: h5py in c:\programdata\anaconda3\lib\site-packages (from keras) (2.7.1)
Requirement already satisfied: pyyaml in c:\programdata\anaconda3\lib\site-packages (from keras) (3.12)
Requirement already satisfied: keras-applications>=1.0.6 in c:\programdata\anaconda3\lib\site-packages (from keras) (1.0.6)
Requirement already satisfied: six>=1.9.0 in c:\programdata\anaconda3\lib\site-packages (from keras) (1.11.0)
Requirement already satisfied: keras-preprocessing>=1.0.5 in c:\programdata\anaconda3\lib\site-packages (from keras) (1.0.5)
You are using pip version 19.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\ProgramData\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Collecting git+https://github.com/raghakot/keras-vis.git
  Cloning https://github.com/raghakot/keras-vis.git to c:\users\tempch~1.021\appdata\local\temp\pip-req-build-rg02656g
Requirement already satisfied, skipping upgrade: keras in c:\programdata\anaconda3\lib\site-packages (from keras-vis==0.4.1) (2.2.4)
Requirement already satisfied, skipping upgrade: six in c:\programdata\anaconda3\lib\site-packages (from keras-vis==0.4.1) (1.11.0)
Requirement already satisfied, skipping upgrade: scikit-image in c:\programdata\anaconda3\lib\site-packages (from keras-vis==0.4.1) (0.13.1)
Requirement already satisfied, skipping upgrade: matplotlib in c:\programdata\anaconda3\lib\site-packages (from keras-vis==0.4.1) (2.2.2)
Requirement already satisfied, skipping upgrade: h5py in c:\programdata\anaconda3\lib\site-packages (from keras-vis==0.4.1) (2.7.1)
Requirement already satisfied, skipping upgrade: numpy>=1.9.1 in c:\programdata\anaconda3\lib\site-packages (from keras->keras-vis==0.4.1) (1.14.3)
Requirement already satisfied, skipping upgrade: keras-preprocessing>=1.0.5 in c:\programdata\anaconda3\lib\site-packages (from keras->keras-vis==0.4.1) (1.0.5)
Requirement already satisfied, skipping upgrade: scipy>=0.14 in c:\programdata\anaconda3\lib\site-packages (from keras->keras-vis==0.4.1) (1.1.0)
Requirement already satisfied, skipping upgrade: keras-applications>=1.0.6 in c:\programdata\anaconda3\lib\site-packages (from keras->keras-vis==0.4.1) (1.0.6)
Requirement already satisfied, skipping upgrade: pyyaml in c:\programdata\anaconda3\lib\site-packages (from keras->keras-vis==0.4.1) (3.12)
Requirement already satisfied, skipping upgrade: networkx>=1.8 in c:\programdata\anaconda3\lib\site-packages (from scikit-image->keras-vis==0.4.1) (2.1)
Requirement already satisfied, skipping upgrade: pillow>=2.1.0 in c:\programdata\anaconda3\lib\site-packages (from scikit-image->keras-vis==0.4.1) (5.1.0)
Requirement already satisfied, skipping upgrade: PyWavelets>=0.4.0 in c:\programdata\anaconda3\lib\site-packages (from scikit-image->keras-vis==0.4.1) (0.5.2)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in c:\programdata\anaconda3\lib\site-packages (from matplotlib->keras-vis==0.4.1) (0.10.0)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\programdata\anaconda3\lib\site-packages (from matplotlib->keras-vis==0.4.1) (2.2.0)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in c:\programdata\anaconda3\lib\site-packages (from matplotlib->keras-vis==0.4.1) (2.7.3)
Requirement already satisfied, skipping upgrade: pytz in c:\programdata\anaconda3\lib\site-packages (from matplotlib->keras-vis==0.4.1) (2018.4)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in c:\programdata\anaconda3\lib\site-packages (from matplotlib->keras-vis==0.4.1) (1.0.1)
Requirement already satisfied, skipping upgrade: decorator>=4.1.0 in c:\programdata\anaconda3\lib\site-packages (from networkx>=1.8->scikit-image->keras-vis==0.4.1) (4.3.0)
Requirement already satisfied, skipping upgrade: setuptools in c:\programdata\anaconda3\lib\site-packages (from kiwisolver>=1.0.1->matplotlib->keras-vis==0.4.1) (40.6.3)
Building wheels for collected packages: keras-vis
  Building wheel for keras-vis (setup.py): started
  Building wheel for keras-vis (setup.py): finished with status 'done'
  Stored in directory: C:\Users\TEMPCH~1.021\AppData\Local\Temp\pip-ephem-wheel-cache-ry1pcmfg\wheels\c5\ae\e7\b34d1cb48b1898f606a5cce08ebc9521fa0588f37f1e590d9f
Successfully built keras-vis
Installing collected packages: keras-vis
  Found existing installation: keras-vis 0.4.1
    Uninstalling keras-vis-0.4.1:
      Successfully uninstalled keras-vis-0.4.1
Successfully installed keras-vis-0.4.1
You are using pip version 19.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

FIRST PART: DATA INGESTION

Import original images from local computer

We used Magnetic Resonance Imaging (MRI) scans from 114 patients with tuberous sclerosis complex (TSC) and from 114 patients with structurally normal MRI (controls).

For each MRI, we manually selected representative axial T2 and T2 FLAIR slices with tubers (in patients with TSC) and with normal findings (in controls). These axial slices were converted to deidentified .jpg images.

We created three folders per TSC and three folders for controls: TSCtrain (566 images), TSCval (130 images), and TSCtest (210 images) and Controltrain (561 images), Controlval (118 images), and Controltest (226 images). Individual patients belonged to only one of the categories (none of the patients had images in different folders).

For the model development part done in a cloud computer environment we only used the train and validation subset. We selected the model with lowest binary cross-entropy error in the validation set as the best model. The best model (InceptionV3) was saved and its performance was evaluated in the local computer on the test set (data not seen previously by the model).

Finally, we visualized the model with class activation maps and saliency maps. To keep a good image visualization size and resolution and with the memory limits of matplotlib.pyplot in jupyter notebooks we divided the images to visualize in three batches in three different jupyter notebooks: I (images from patients 1-8 and controls 1-8), II (images from patients 9-16 and controls 9-16), and III (images from patients 17-25 and controls 17-25).

In [2]:
# Set the figure size
mpl.rcParams['figure.figsize'] = (16,10)
In [3]:
# Unzip files
with zipfile.ZipFile("Controltest1725.zip","r") as zip_ref:
    zip_ref.extractall()
with zipfile.ZipFile("TSCtest1725.zip","r") as zip_ref:
    zip_ref.extractall()

Path to original images folder

In [4]:
# Path to the folder with the original images
pathtoimagesControltest = './Controltest1725/'

pathtoimagesTSCtest = './TSCtest1725/'

SECOND PART: IMPORTATION OF FINAL DATA

Import images and labels for the test set

In [5]:
## CONTROLS

# Define the image size
image_size = (224, 224)

# Read in the test images for controls
Controltest_images = []
Controltest_dir = pathtoimagesControltest
Controltest_files = os.listdir(Controltest_dir)
# For each image
for f in Controltest_files:
  # Open the image
  img = Image.open(Controltest_dir + f)
  # Resize the image so that it has a size 224x224
  img = img.resize(image_size)
  # Transform into a numpy array
  img_arr = np.array(img)
  # Transform from 224x224 to 224x224x3
  if img_arr.shape == image_size:
        img_arr = np.expand_dims(img_arr, 3)
        img_arr = gray2rgb(img_arr[:, :, 0])
  # Add the image to the array of images      
  Controltest_images.append(img_arr)

# After having transformed all images, transform the list into a numpy array  
Controltest_X = np.array(Controltest_images)

# Create an array of labels (0 for controls)
Controltest_y = np.array([[0]*Controltest_X.shape[0]]).T



## TSC

# Read in the test images for TSC
TSCtest_images = []
TSCtest_dir = pathtoimagesTSCtest
TSCtest_files = os.listdir(TSCtest_dir)
# For each image
for f in TSCtest_files:
  # Open the image
  img = Image.open(TSCtest_dir + f)
  # Resize the image so that it has a size 224x224
  img = img.resize(image_size)
  # Transform into a numpy array
  img_arr = np.array(img)
  # Transform from 224x224 to 224x224x3
  if img_arr.shape == image_size:
        img_arr = np.expand_dims(img_arr, 3)
        img_arr = gray2rgb(img_arr[:, :, 0])
  # Add the image to the array of images      
  TSCtest_images.append(img_arr)

# After having transformed all images, transform the list into a numpy array  
TSCtest_X = np.array(TSCtest_images)

# Create an array of labels (1 for TSC)
TSCtest_y = np.array([[1]*TSCtest_X.shape[0]]).T


## MERGE CONTROLS AND TSC

# Train merge files
test_X = np.concatenate([Controltest_X, TSCtest_X])
test_y = np.vstack((Controltest_y, TSCtest_y))

# GPU expects values to be 32-bit floats
test_X = test_X.astype(np.float32)

# Rescale the values to be between 0 and 1
test_X /= 255.
In [6]:
# Shuffle in unison the test_X and the test_y array (123 is just a random number for reproducibility)
shuffled_test_X, shuffled_test_y = shuffle(test_X, test_y, random_state=123)
In [7]:
shuffled_test_X.shape
Out[7]:
(126, 224, 224, 3)
In [8]:
# Example of an image to make sure they were converted right
plt.imshow(shuffled_test_X[0])
plt.grid(b=None)
plt.xticks([])
plt.yticks([])
plt.show()
In [9]:
shuffled_test_y.shape
Out[9]:
(126, 1)
In [10]:
shuffled_test_y[0]
Out[10]:
array([0])

THIRD PART: VISUALIZE CLASS ACTIVATION MAPS AND SALIENCY MAPS

Load the model

In [11]:
# load model
json_file = open('InceptionV3.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
model = model_from_json(loaded_model_json)
# load weights into new model
model.load_weights("InceptionV3.h5")
In [12]:
# Compile model
model.compile(optimizer = Adam(lr = 0.00025), loss = 'binary_crossentropy', metrics = ['accuracy'])

# Generate predictions on test data in the form of probabilities
testInceptionV3 = model.predict(shuffled_test_X, batch_size = 16)
testInceptionV3
Out[12]:
array([[9.1407180e-04],
       [9.9222720e-01],
       [9.2708123e-01],
       [9.9909914e-01],
       [3.5520327e-06],
       [4.4977017e-07],
       [2.2230590e-04],
       [9.9999988e-01],
       [8.1199223e-01],
       [5.6639101e-06],
       [1.2175875e-05],
       [1.1848413e-08],
       [1.8346060e-05],
       [2.3424961e-03],
       [9.1407180e-04],
       [5.7211320e-05],
       [2.2675197e-04],
       [1.0000000e+00],
       [1.0000000e+00],
       [1.8582561e-07],
       [9.9930799e-01],
       [5.1013296e-05],
       [1.2609881e-05],
       [9.3655757e-07],
       [9.9988294e-01],
       [9.9957782e-01],
       [8.4598630e-04],
       [4.3754656e-07],
       [6.2727165e-01],
       [8.2191903e-08],
       [3.9717667e-02],
       [9.0923643e-01],
       [2.3107727e-06],
       [1.1288202e-01],
       [9.9955589e-01],
       [9.9942482e-01],
       [3.3707570e-07],
       [9.9991012e-01],
       [3.3087319e-06],
       [9.9997807e-01],
       [9.9877602e-01],
       [1.9845215e-06],
       [4.7023714e-06],
       [2.5757884e-06],
       [8.1548643e-01],
       [7.0723599e-01],
       [9.8901761e-01],
       [9.9999845e-01],
       [8.9443564e-01],
       [6.7536450e-05],
       [9.0149999e-01],
       [1.4411116e-07],
       [5.1012128e-05],
       [9.5708120e-01],
       [9.9963975e-01],
       [2.7867196e-07],
       [9.9802822e-01],
       [9.4047308e-01],
       [3.4879270e-07],
       [2.0432311e-04],
       [9.9985087e-01],
       [9.9999940e-01],
       [2.1795704e-10],
       [9.9999416e-01],
       [1.2208645e-03],
       [4.9616465e-06],
       [9.7579878e-06],
       [8.5027108e-07],
       [2.9642153e-01],
       [2.3827265e-06],
       [9.9993145e-01],
       [2.1672602e-04],
       [9.9825209e-01],
       [4.5961460e-05],
       [4.8218750e-05],
       [3.3373963e-05],
       [1.7456382e-06],
       [2.9674202e-06],
       [9.9998856e-01],
       [9.9893767e-01],
       [4.8892857e-06],
       [9.9998343e-01],
       [1.3856011e-06],
       [2.8685844e-07],
       [9.9999988e-01],
       [1.9325073e-05],
       [8.5264867e-07],
       [9.9981898e-01],
       [3.4673353e-06],
       [8.4362465e-01],
       [3.3612909e-07],
       [1.5286526e-08],
       [7.7744633e-01],
       [9.9982685e-01],
       [9.9968779e-01],
       [4.3043536e-07],
       [9.9999893e-01],
       [7.2045696e-06],
       [9.9995244e-01],
       [1.9484540e-02],
       [1.0915727e-06],
       [5.7682902e-01],
       [9.9975854e-01],
       [9.9997580e-01],
       [3.0971245e-07],
       [9.6130300e-01],
       [9.7004783e-01],
       [1.7234561e-04],
       [9.9999976e-01],
       [1.9175629e-06],
       [6.8523827e-06],
       [9.9927109e-01],
       [3.1327643e-06],
       [1.0000000e+00],
       [9.9956614e-01],
       [9.9998546e-01],
       [9.9993026e-01],
       [1.1351166e-06],
       [1.6681987e-04],
       [9.9991071e-01],
       [7.5893113e-06],
       [3.2150722e-01],
       [9.9999809e-01],
       [9.9996340e-01],
       [3.5906571e-05],
       [9.9995959e-01]], dtype=float32)
In [13]:
# Relabel actual outcomes and estimated probabilities
y_true = shuffled_test_y
y_predInceptionV3 = testInceptionV3 > 0.5

Visualize the data

In [14]:
# Visualize the structure and layers of the model
model.layers
Out[14]:
[<keras.engine.input_layer.InputLayer at 0x11a19a90>,
 <keras.layers.convolutional.Conv2D at 0x11a19b00>,
 <keras.layers.normalization.BatchNormalization at 0x11a19da0>,
 <keras.layers.core.Activation at 0x11a19f28>,
 <keras.layers.convolutional.Conv2D at 0x11a29278>,
 <keras.layers.normalization.BatchNormalization at 0x11a29400>,
 <keras.layers.core.Activation at 0x11a29518>,
 <keras.layers.convolutional.Conv2D at 0x11a29550>,
 <keras.layers.normalization.BatchNormalization at 0x11a296d8>,
 <keras.layers.core.Activation at 0x11a297f0>,
 <keras.layers.pooling.MaxPooling2D at 0x11a29828>,
 <keras.layers.convolutional.Conv2D at 0x11a298d0>,
 <keras.layers.normalization.BatchNormalization at 0x11a29a58>,
 <keras.layers.core.Activation at 0x11a29b70>,
 <keras.layers.convolutional.Conv2D at 0x11a29ba8>,
 <keras.layers.normalization.BatchNormalization at 0x11a29d30>,
 <keras.layers.core.Activation at 0x11a29e48>,
 <keras.layers.pooling.MaxPooling2D at 0x11a29e80>,
 <keras.layers.convolutional.Conv2D at 0x11a29f28>,
 <keras.layers.normalization.BatchNormalization at 0x11a3e0f0>,
 <keras.layers.core.Activation at 0x11a3e208>,
 <keras.layers.convolutional.Conv2D at 0x11a3e240>,
 <keras.layers.convolutional.Conv2D at 0x11a3e3c8>,
 <keras.layers.normalization.BatchNormalization at 0x11a3e550>,
 <keras.layers.normalization.BatchNormalization at 0x11a3e668>,
 <keras.layers.core.Activation at 0x11a3e780>,
 <keras.layers.core.Activation at 0x11a3e7b8>,
 <keras.layers.pooling.AveragePooling2D at 0x11a3e7f0>,
 <keras.layers.convolutional.Conv2D at 0x11a3e898>,
 <keras.layers.convolutional.Conv2D at 0x11a3ea20>,
 <keras.layers.convolutional.Conv2D at 0x11a3eba8>,
 <keras.layers.convolutional.Conv2D at 0x11a3ed30>,
 <keras.layers.normalization.BatchNormalization at 0x11a3eeb8>,
 <keras.layers.normalization.BatchNormalization at 0x11a19fd0>,
 <keras.layers.normalization.BatchNormalization at 0x11a43128>,
 <keras.layers.normalization.BatchNormalization at 0x11a43240>,
 <keras.layers.core.Activation at 0x11a43358>,
 <keras.layers.core.Activation at 0x11a43390>,
 <keras.layers.core.Activation at 0x11a433c8>,
 <keras.layers.core.Activation at 0x11a43400>,
 <keras.layers.merge.Concatenate at 0x11a43438>,
 <keras.layers.convolutional.Conv2D at 0x11a43470>,
 <keras.layers.normalization.BatchNormalization at 0x11a435f8>,
 <keras.layers.core.Activation at 0x11a43710>,
 <keras.layers.convolutional.Conv2D at 0x11a43748>,
 <keras.layers.convolutional.Conv2D at 0x11a438d0>,
 <keras.layers.normalization.BatchNormalization at 0x11a43a58>,
 <keras.layers.normalization.BatchNormalization at 0x11a43b70>,
 <keras.layers.core.Activation at 0x11a43c88>,
 <keras.layers.core.Activation at 0x11a43cc0>,
 <keras.layers.pooling.AveragePooling2D at 0x11a43cf8>,
 <keras.layers.convolutional.Conv2D at 0x11a43da0>,
 <keras.layers.convolutional.Conv2D at 0x11a43f28>,
 <keras.layers.convolutional.Conv2D at 0x11a4b0f0>,
 <keras.layers.convolutional.Conv2D at 0x11a4b278>,
 <keras.layers.normalization.BatchNormalization at 0x11a4b400>,
 <keras.layers.normalization.BatchNormalization at 0x11a4b518>,
 <keras.layers.normalization.BatchNormalization at 0x11a4b630>,
 <keras.layers.normalization.BatchNormalization at 0x11a4b748>,
 <keras.layers.core.Activation at 0x11a4b860>,
 <keras.layers.core.Activation at 0x11a4b898>,
 <keras.layers.core.Activation at 0x11a4b8d0>,
 <keras.layers.core.Activation at 0x11a4b908>,
 <keras.layers.merge.Concatenate at 0x11a4b940>,
 <keras.layers.convolutional.Conv2D at 0x11a4b978>,
 <keras.layers.normalization.BatchNormalization at 0x11a4bb00>,
 <keras.layers.core.Activation at 0x11a4bc18>,
 <keras.layers.convolutional.Conv2D at 0x11a4bc50>,
 <keras.layers.convolutional.Conv2D at 0x11a4bdd8>,
 <keras.layers.normalization.BatchNormalization at 0x11a4bf60>,
 <keras.layers.normalization.BatchNormalization at 0x11a3efd0>,
 <keras.layers.core.Activation at 0x11a521d0>,
 <keras.layers.core.Activation at 0x11a52208>,
 <keras.layers.pooling.AveragePooling2D at 0x11a52240>,
 <keras.layers.convolutional.Conv2D at 0x11a522e8>,
 <keras.layers.convolutional.Conv2D at 0x11a52470>,
 <keras.layers.convolutional.Conv2D at 0x11a525f8>,
 <keras.layers.convolutional.Conv2D at 0x11a52780>,
 <keras.layers.normalization.BatchNormalization at 0x11a52908>,
 <keras.layers.normalization.BatchNormalization at 0x11a52a20>,
 <keras.layers.normalization.BatchNormalization at 0x11a52b38>,
 <keras.layers.normalization.BatchNormalization at 0x11a52c50>,
 <keras.layers.core.Activation at 0x11a52d68>,
 <keras.layers.core.Activation at 0x11a52da0>,
 <keras.layers.core.Activation at 0x11a52dd8>,
 <keras.layers.core.Activation at 0x11a52e10>,
 <keras.layers.merge.Concatenate at 0x11a52e48>,
 <keras.layers.convolutional.Conv2D at 0x11a52e80>,
 <keras.layers.normalization.BatchNormalization at 0x11a5a048>,
 <keras.layers.core.Activation at 0x11a5a160>,
 <keras.layers.convolutional.Conv2D at 0x11a5a198>,
 <keras.layers.normalization.BatchNormalization at 0x11a5a320>,
 <keras.layers.core.Activation at 0x11a5a438>,
 <keras.layers.convolutional.Conv2D at 0x11a5a470>,
 <keras.layers.convolutional.Conv2D at 0x11a5a5f8>,
 <keras.layers.normalization.BatchNormalization at 0x11a5a780>,
 <keras.layers.normalization.BatchNormalization at 0x11a5a898>,
 <keras.layers.core.Activation at 0x11a5a9b0>,
 <keras.layers.core.Activation at 0x11a5a9e8>,
 <keras.layers.pooling.MaxPooling2D at 0x11a5aa20>,
 <keras.layers.merge.Concatenate at 0x11a5aac8>,
 <keras.layers.convolutional.Conv2D at 0x11a5ab00>,
 <keras.layers.normalization.BatchNormalization at 0x11a5ac88>,
 <keras.layers.core.Activation at 0x11a5ada0>,
 <keras.layers.convolutional.Conv2D at 0x11a5add8>,
 <keras.layers.normalization.BatchNormalization at 0x11a5af60>,
 <keras.layers.core.Activation at 0x11a4bfd0>,
 <keras.layers.convolutional.Conv2D at 0x11a620f0>,
 <keras.layers.convolutional.Conv2D at 0x11a62278>,
 <keras.layers.normalization.BatchNormalization at 0x11a62400>,
 <keras.layers.normalization.BatchNormalization at 0x11a62518>,
 <keras.layers.core.Activation at 0x11a62630>,
 <keras.layers.core.Activation at 0x11a62668>,
 <keras.layers.convolutional.Conv2D at 0x11a626a0>,
 <keras.layers.convolutional.Conv2D at 0x11a62828>,
 <keras.layers.normalization.BatchNormalization at 0x11a629b0>,
 <keras.layers.normalization.BatchNormalization at 0x11a62ac8>,
 <keras.layers.core.Activation at 0x11a62be0>,
 <keras.layers.core.Activation at 0x11a62c18>,
 <keras.layers.pooling.AveragePooling2D at 0x11a62c50>,
 <keras.layers.convolutional.Conv2D at 0x11a62cf8>,
 <keras.layers.convolutional.Conv2D at 0x11a62e80>,
 <keras.layers.convolutional.Conv2D at 0x11a69048>,
 <keras.layers.convolutional.Conv2D at 0x11a691d0>,
 <keras.layers.normalization.BatchNormalization at 0x11a69358>,
 <keras.layers.normalization.BatchNormalization at 0x11a69470>,
 <keras.layers.normalization.BatchNormalization at 0x11a69588>,
 <keras.layers.normalization.BatchNormalization at 0x11a696a0>,
 <keras.layers.core.Activation at 0x11a697b8>,
 <keras.layers.core.Activation at 0x11a697f0>,
 <keras.layers.core.Activation at 0x11a69828>,
 <keras.layers.core.Activation at 0x11a69860>,
 <keras.layers.merge.Concatenate at 0x11a69898>,
 <keras.layers.convolutional.Conv2D at 0x11a698d0>,
 <keras.layers.normalization.BatchNormalization at 0x11a69a58>,
 <keras.layers.core.Activation at 0x11a69b70>,
 <keras.layers.convolutional.Conv2D at 0x11a69ba8>,
 <keras.layers.normalization.BatchNormalization at 0x11a69d30>,
 <keras.layers.core.Activation at 0x11a69e48>,
 <keras.layers.convolutional.Conv2D at 0x11a69e80>,
 <keras.layers.convolutional.Conv2D at 0x11a71048>,
 <keras.layers.normalization.BatchNormalization at 0x11a711d0>,
 <keras.layers.normalization.BatchNormalization at 0x11a712e8>,
 <keras.layers.core.Activation at 0x11a71400>,
 <keras.layers.core.Activation at 0x11a71438>,
 <keras.layers.convolutional.Conv2D at 0x11a71470>,
 <keras.layers.convolutional.Conv2D at 0x11a715f8>,
 <keras.layers.normalization.BatchNormalization at 0x11a71780>,
 <keras.layers.normalization.BatchNormalization at 0x11a71898>,
 <keras.layers.core.Activation at 0x11a719b0>,
 <keras.layers.core.Activation at 0x11a719e8>,
 <keras.layers.pooling.AveragePooling2D at 0x11a71a20>,
 <keras.layers.convolutional.Conv2D at 0x11a71ac8>,
 <keras.layers.convolutional.Conv2D at 0x11a71c50>,
 <keras.layers.convolutional.Conv2D at 0x11a71dd8>,
 <keras.layers.convolutional.Conv2D at 0x11a71f60>,
 <keras.layers.normalization.BatchNormalization at 0x11a79128>,
 <keras.layers.normalization.BatchNormalization at 0x11a79240>,
 <keras.layers.normalization.BatchNormalization at 0x11a79358>,
 <keras.layers.normalization.BatchNormalization at 0x11a79470>,
 <keras.layers.core.Activation at 0x11a79588>,
 <keras.layers.core.Activation at 0x11a795c0>,
 <keras.layers.core.Activation at 0x11a795f8>,
 <keras.layers.core.Activation at 0x11a79630>,
 <keras.layers.merge.Concatenate at 0x11a79668>,
 <keras.layers.convolutional.Conv2D at 0x11a796a0>,
 <keras.layers.normalization.BatchNormalization at 0x11a79828>,
 <keras.layers.core.Activation at 0x11a79940>,
 <keras.layers.convolutional.Conv2D at 0x11a79978>,
 <keras.layers.normalization.BatchNormalization at 0x11a79b00>,
 <keras.layers.core.Activation at 0x11a79c18>,
 <keras.layers.convolutional.Conv2D at 0x11a79c50>,
 <keras.layers.convolutional.Conv2D at 0x11a79dd8>,
 <keras.layers.normalization.BatchNormalization at 0x11a79f60>,
 <keras.layers.normalization.BatchNormalization at 0x11a5afd0>,
 <keras.layers.core.Activation at 0x11a811d0>,
 <keras.layers.core.Activation at 0x11a81208>,
 <keras.layers.convolutional.Conv2D at 0x11a81240>,
 <keras.layers.convolutional.Conv2D at 0x11a813c8>,
 <keras.layers.normalization.BatchNormalization at 0x11a81550>,
 <keras.layers.normalization.BatchNormalization at 0x11a81668>,
 <keras.layers.core.Activation at 0x11a81780>,
 <keras.layers.core.Activation at 0x11a817b8>,
 <keras.layers.pooling.AveragePooling2D at 0x11a817f0>,
 <keras.layers.convolutional.Conv2D at 0x11a81898>,
 <keras.layers.convolutional.Conv2D at 0x11a81a20>,
 <keras.layers.convolutional.Conv2D at 0x11a81ba8>,
 <keras.layers.convolutional.Conv2D at 0x11a81d30>,
 <keras.layers.normalization.BatchNormalization at 0x11a81eb8>,
 <keras.layers.normalization.BatchNormalization at 0x11a79fd0>,
 <keras.layers.normalization.BatchNormalization at 0x11a87128>,
 <keras.layers.normalization.BatchNormalization at 0x11a87240>,
 <keras.layers.core.Activation at 0x11a87358>,
 <keras.layers.core.Activation at 0x11a87390>,
 <keras.layers.core.Activation at 0x11a873c8>,
 <keras.layers.core.Activation at 0x11a87400>,
 <keras.layers.merge.Concatenate at 0x11a87438>,
 <keras.layers.convolutional.Conv2D at 0x11a87470>,
 <keras.layers.normalization.BatchNormalization at 0x11a875f8>,
 <keras.layers.core.Activation at 0x11a87710>,
 <keras.layers.convolutional.Conv2D at 0x11a87748>,
 <keras.layers.normalization.BatchNormalization at 0x11a878d0>,
 <keras.layers.core.Activation at 0x11a879e8>,
 <keras.layers.convolutional.Conv2D at 0x11a87a20>,
 <keras.layers.convolutional.Conv2D at 0x11a87ba8>,
 <keras.layers.normalization.BatchNormalization at 0x11a87d30>,
 <keras.layers.normalization.BatchNormalization at 0x11a87e48>,
 <keras.layers.core.Activation at 0x11a87f60>,
 <keras.layers.core.Activation at 0x11a87f98>,
 <keras.layers.convolutional.Conv2D at 0x11a81fd0>,
 <keras.layers.convolutional.Conv2D at 0x11a8e198>,
 <keras.layers.normalization.BatchNormalization at 0x11a8e320>,
 <keras.layers.normalization.BatchNormalization at 0x11a8e438>,
 <keras.layers.core.Activation at 0x11a8e550>,
 <keras.layers.core.Activation at 0x11a8e588>,
 <keras.layers.pooling.AveragePooling2D at 0x11a8e5c0>,
 <keras.layers.convolutional.Conv2D at 0x11a8e668>,
 <keras.layers.convolutional.Conv2D at 0x11a8e7f0>,
 <keras.layers.convolutional.Conv2D at 0x11a8e978>,
 <keras.layers.convolutional.Conv2D at 0x11a8eb00>,
 <keras.layers.normalization.BatchNormalization at 0x11a8ec88>,
 <keras.layers.normalization.BatchNormalization at 0x11a8eda0>,
 <keras.layers.normalization.BatchNormalization at 0x11a8eeb8>,
 <keras.layers.normalization.BatchNormalization at 0x11a87fd0>,
 <keras.layers.core.Activation at 0x11a95128>,
 <keras.layers.core.Activation at 0x11a95160>,
 <keras.layers.core.Activation at 0x11a95198>,
 <keras.layers.core.Activation at 0x11a951d0>,
 <keras.layers.merge.Concatenate at 0x11a95208>,
 <keras.layers.convolutional.Conv2D at 0x11a95240>,
 <keras.layers.normalization.BatchNormalization at 0x11a953c8>,
 <keras.layers.core.Activation at 0x11a954e0>,
 <keras.layers.convolutional.Conv2D at 0x11a95518>,
 <keras.layers.normalization.BatchNormalization at 0x11a956a0>,
 <keras.layers.core.Activation at 0x11a957b8>,
 <keras.layers.convolutional.Conv2D at 0x11a957f0>,
 <keras.layers.convolutional.Conv2D at 0x11a95978>,
 <keras.layers.normalization.BatchNormalization at 0x11a95b00>,
 <keras.layers.normalization.BatchNormalization at 0x11a95c18>,
 <keras.layers.core.Activation at 0x11a95d30>,
 <keras.layers.core.Activation at 0x11a95d68>,
 <keras.layers.convolutional.Conv2D at 0x11a95da0>,
 <keras.layers.convolutional.Conv2D at 0x11a95f28>,
 <keras.layers.normalization.BatchNormalization at 0x11a9e0f0>,
 <keras.layers.normalization.BatchNormalization at 0x11a9e208>,
 <keras.layers.core.Activation at 0x11a9e320>,
 <keras.layers.core.Activation at 0x11a9e358>,
 <keras.layers.pooling.MaxPooling2D at 0x11a9e390>,
 <keras.layers.merge.Concatenate at 0x11a9e438>,
 <keras.layers.convolutional.Conv2D at 0x11a9e470>,
 <keras.layers.normalization.BatchNormalization at 0x11a9e5f8>,
 <keras.layers.core.Activation at 0x11a9e710>,
 <keras.layers.convolutional.Conv2D at 0x11a9e748>,
 <keras.layers.convolutional.Conv2D at 0x11a9e8d0>,
 <keras.layers.normalization.BatchNormalization at 0x11a9ea58>,
 <keras.layers.normalization.BatchNormalization at 0x11a9eb70>,
 <keras.layers.core.Activation at 0x11a9ec88>,
 <keras.layers.core.Activation at 0x11a9ecc0>,
 <keras.layers.convolutional.Conv2D at 0x11a9ecf8>,
 <keras.layers.convolutional.Conv2D at 0x11a9ee80>,
 <keras.layers.convolutional.Conv2D at 0x11aa6048>,
 <keras.layers.convolutional.Conv2D at 0x11aa61d0>,
 <keras.layers.pooling.AveragePooling2D at 0x11aa6358>,
 <keras.layers.convolutional.Conv2D at 0x11aa6400>,
 <keras.layers.normalization.BatchNormalization at 0x11aa6588>,
 <keras.layers.normalization.BatchNormalization at 0x11aa66a0>,
 <keras.layers.normalization.BatchNormalization at 0x11aa67b8>,
 <keras.layers.normalization.BatchNormalization at 0x11aa68d0>,
 <keras.layers.convolutional.Conv2D at 0x11aa69e8>,
 <keras.layers.normalization.BatchNormalization at 0x11aa6b70>,
 <keras.layers.core.Activation at 0x11aa6c88>,
 <keras.layers.core.Activation at 0x11aa6cc0>,
 <keras.layers.core.Activation at 0x11aa6cf8>,
 <keras.layers.core.Activation at 0x11aa6d30>,
 <keras.layers.normalization.BatchNormalization at 0x11aa6d68>,
 <keras.layers.core.Activation at 0x11aa6e80>,
 <keras.layers.merge.Concatenate at 0x11aa6eb8>,
 <keras.layers.merge.Concatenate at 0x11aa6ef0>,
 <keras.layers.core.Activation at 0x11aa6f28>,
 <keras.layers.merge.Concatenate at 0x11aa6f60>,
 <keras.layers.convolutional.Conv2D at 0x11aa6f98>,
 <keras.layers.normalization.BatchNormalization at 0x11aae160>,
 <keras.layers.core.Activation at 0x11aae278>,
 <keras.layers.convolutional.Conv2D at 0x11aae2b0>,
 <keras.layers.convolutional.Conv2D at 0x11aae438>,
 <keras.layers.normalization.BatchNormalization at 0x11aae5c0>,
 <keras.layers.normalization.BatchNormalization at 0x11aae6d8>,
 <keras.layers.core.Activation at 0x11aae7f0>,
 <keras.layers.core.Activation at 0x11aae828>,
 <keras.layers.convolutional.Conv2D at 0x11aae860>,
 <keras.layers.convolutional.Conv2D at 0x11aae9e8>,
 <keras.layers.convolutional.Conv2D at 0x11aaeb70>,
 <keras.layers.convolutional.Conv2D at 0x11aaecf8>,
 <keras.layers.pooling.AveragePooling2D at 0x11aaee80>,
 <keras.layers.convolutional.Conv2D at 0x11aaef28>,
 <keras.layers.normalization.BatchNormalization at 0x11ab70f0>,
 <keras.layers.normalization.BatchNormalization at 0x11ab7208>,
 <keras.layers.normalization.BatchNormalization at 0x11ab7320>,
 <keras.layers.normalization.BatchNormalization at 0x11ab7438>,
 <keras.layers.convolutional.Conv2D at 0x11ab7550>,
 <keras.layers.normalization.BatchNormalization at 0x11ab76d8>,
 <keras.layers.core.Activation at 0x11ab77f0>,
 <keras.layers.core.Activation at 0x11ab7828>,
 <keras.layers.core.Activation at 0x11ab7860>,
 <keras.layers.core.Activation at 0x11ab7898>,
 <keras.layers.normalization.BatchNormalization at 0x11ab78d0>,
 <keras.layers.core.Activation at 0x11ab79e8>,
 <keras.layers.merge.Concatenate at 0x11ab7a20>,
 <keras.layers.merge.Concatenate at 0x11ab7a58>,
 <keras.layers.core.Activation at 0x11ab7a90>,
 <keras.layers.merge.Concatenate at 0x11ab7ac8>,
 <keras.layers.pooling.GlobalAveragePooling2D at 0x11ab7b00>,
 <keras.layers.core.Dense at 0x11ab7b70>,
 <keras.layers.core.Dense at 0x11ab7cc0>]
In [15]:
# Iterate through the MRIs in test set

print('\n \n' + '\033[1m' + 'EACH ORIGINAL IMAGE IS ANALYZED WITH TWO METHODS: CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)' + '\033[0m' + '\n')
print('\033[1m' + 'FOR EACH METHOD, THE FIRST IMAGE IS THE ORIGINAL IMAGE, THE SECOND IMAGE IS THE MAP, AND THE THIRD IMAGE IS THE MAP SUPERIMPOSED ON THE ORIGINAL IMAGE WITH A TRANSPARENCY THAT IS PROPORTIONAL TO THE ESTIMATED PROBABILITY OF THE IMAGE HAVING TUBER(S) (HIGHER ESTIMATED PROBABILITIES PRODUCE CLEARLY SEEN MAPS OVERLAID ON THE ORIGINAL IMAGE AND LOWER ESTIMATED PROBABILITIES PRODUCE VERY TRANSPARENT MAPS OVERLAYED ON THE ORIGINAL IMAGE)' + '\033[0m'+ '\n \n \n \n')


for i in range(shuffled_test_X.shape[0]):
    
  # Print spaces to separate from the next image
  print('\n \n \n \n \n \n \n \n')
  
  # Print real classification of the image
  print('\033[1m' + 'REAL CLASSIFICATION OF THE IMAGE: {}'.format('TSC' if y_true[i][0]==1 else 'NO TSC') + '\033[0m')
  # Print model classification and model probability of TSC
  print('Model classification of this image: {} \nEstimated probability of tuber(s): {} \n'.format('TSC' if testInceptionV3[i][0]>0.5 else 'NO TSC', testInceptionV3[i][0]))     


  # Print title
  print('\033[1m' + 'CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)' + '\033[0m')     
    
  # Original image
  plt.subplot(2,3,1)
  plt.imshow(shuffled_test_X[i])
  plt.grid(b=None)
  plt.xticks([])
  plt.yticks([])
  
  # Heat map
  plt.subplot(2,3,2)
  heat_map = visualize_cam(model, layer_idx=300, filter_indices=None, seed_input=shuffled_test_X[i])
  plt.imshow(heat_map)
  plt.grid(b=None)
  plt.xticks([])
  plt.yticks([])
  
  # Heat map superimposed on original image
  plt.subplot(2,3,3)
  plt.imshow(shuffled_test_X[i])
  plt.imshow(heat_map, alpha = 0.8 * testInceptionV3[i][0])
  plt.grid(b=None)
  plt.xticks([])
  plt.yticks([])

       
  # Original image
  plt.subplot(2,3,4)
  plt.imshow(shuffled_test_X[i])
  plt.grid(b=None)
  plt.xticks([])
  plt.yticks([])


  # Heat map
  heat_map = visualize_saliency(model, layer_idx=300, filter_indices=None, seed_input=shuffled_test_X[i])
  plt.subplot(2,3,5)
  plt.imshow(heat_map)
  plt.grid(b=None)
  plt.xticks([])
  plt.yticks([])
  
  # Heat map superimposed on original image
  plt.subplot(2,3,6)
  plt.imshow(shuffled_test_X[i])
  plt.imshow(heat_map, alpha = 0.8 * testInceptionV3[i][0])
  plt.grid(b=None)
  plt.xticks([])
  plt.yticks([])

  # Show the image and close it
  plt.show()
  plt.close()
 
EACH ORIGINAL IMAGE IS ANALYZED WITH TWO METHODS: CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)

FOR EACH METHOD, THE FIRST IMAGE IS THE ORIGINAL IMAGE, THE SECOND IMAGE IS THE MAP, AND THE THIRD IMAGE IS THE MAP SUPERIMPOSED ON THE ORIGINAL IMAGE WITH A TRANSPARENCY THAT IS PROPORTIONAL TO THE ESTIMATED PROBABILITY OF THE IMAGE HAVING TUBER(S) (HIGHER ESTIMATED PROBABILITIES PRODUCE CLEARLY SEEN MAPS OVERLAID ON THE ORIGINAL IMAGE AND LOWER ESTIMATED PROBABILITIES PRODUCE VERY TRANSPARENT MAPS OVERLAYED ON THE ORIGINAL IMAGE)
 
 
 


 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0009140718029811978 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9922271966934204 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9270812273025513 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9990991353988647 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.5520326946425484e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.497701695527212e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.00022230589820537716 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999998807907104 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.8119922280311584 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 5.663910087605473e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.2175874871900305e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.1848412917458973e-08 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.8346059732721187e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0023424960672855377 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0009140718029811978 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 5.7211320381611586e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.00022675197396893054 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 1.0 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 1.0 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.858256126752167e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9993079900741577 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 5.1013295887969434e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.2609881196112838e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 9.365575692754646e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9998829364776611 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9995778203010559 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.000845986302010715 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.3754656076089304e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.6272716522216797 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 8.219190306135715e-08 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0397176668047905 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9092364311218262 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.310772742930567e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.11288201808929443 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9995558857917786 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9994248151779175 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.3707570423757716e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999101161956787 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.308731947981869e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999780654907227 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9987760186195374 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.9845215319946874e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.702371370512992e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.5757883577171015e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.8154864311218262 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.7072359919548035 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9890176057815552 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999984502792358 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.8944356441497803 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 6.753644993295893e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9014999866485596 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.4411115500934102e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 5.101212809677236e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9570811986923218 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9996397495269775 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.786719619507494e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9980282187461853 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9404730796813965 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.4879269605880836e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.00020432310702744871 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.999850869178772 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999994039535522 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.1795704130411764e-10 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.999994158744812 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0012208644766360521 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.9616464821156114e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 9.757987754710484e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 8.502710784341616e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.29642152786254883 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.3827265067666303e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999314546585083 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0002167260245187208 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9982520937919617 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.596146027324721e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.821874972549267e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.337396265123971e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.745638201100519e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.967420186905656e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999885559082031 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9989376664161682 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.889285719400505e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999834299087524 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.3856010809831787e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 2.8685843744824524e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999998807907104 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.932507257151883e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 8.526486681148526e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9998189806938171 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.467335318418918e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.8436246514320374 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.361290907832881e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.5286525822943986e-08 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.7774463295936584 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9998268485069275 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9996877908706665 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 4.3043536379627767e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.999998927116394 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 7.204569556051865e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999524354934692 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.019484540447592735 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.0915726988969254e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.5768290162086487 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9997585415840149 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999758005142212 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.097124476880708e-07 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9613029956817627 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9700478315353394 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.0001723456080071628 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999997615814209 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.9175629404344363e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 6.852382739452878e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9992710947990417 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.1327642773248954e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 1.0 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9995661377906799 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999854564666748 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999302625656128 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 1.135116576733708e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.00016681986744515598 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999107122421265 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 7.5893112807534635e-06 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 0.32150721549987793 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999980926513672 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999634027481079 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: NO TSC
Model classification of this image: NO TSC 
Estimated probability of tuber(s): 3.590657070162706e-05 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)
 
 
 
 
 
 
 

REAL CLASSIFICATION OF THE IMAGE: TSC
Model classification of this image: TSC 
Estimated probability of tuber(s): 0.9999595880508423 

CLASS ACTIVATION MAP (UPPER ROW) AND SALIENCY MAP (LOWER ROW)

SCROLL UP TO SEE THE GradCAM AND SALIENCY MAPS OF EACH IMAGE

Each original image is analyzed with two methods: Gradient-weighted class activation maps (upper row) and saliency maps (lower row).

For each method, the first image is the original image, the second image is the map, and the third image is the map superimposed on the original image with a transparency that is proportional to the estimated probability of the image having tuber(s) (higher estimated probabilities produce clearly seen maps overlaid on the original image and lower estimated probabilities produce very transparent maps overlaid on the original image).