Day 39 – Predict an Image Using Xception Pre-trained Model

Xception architecture is similar to InceptionV3; however, the model parameters are efficiently used in Xception.  This is another pretrained model in Convolutional Neural Networks – Layers, Filters, and Architectures.

To know about the Xception, you can visit the research paper “Xception: Deep Learning with Depthwise Separable Convolutions.”

Image Source: Pexels

We have already gone through Convolutional Neural Networks – Layers, Filters, and Architectures, Predict Image Using ResNet50 Pretrained Model, Predict An Image Using InceptionV3 Pretrained Model, Predict an Image Using MobileNetV3 Pretrained Model for Mobile, Predict an Image Using NasNetMobile Pretrained Model for Mobile and Predict An Image Using VGG19 Pretrained Model in the previous blogs. We don’t need to create a new architecture from scratch for our projects; instead, we can use existing Convolutional Neural Networks(CNN) popular architectures like LeNet-5, ResNet, VGG16, VGG19, InceptionV3, MobileNetV3, NASNetMobile, etc. models to check how it predicts.

Today, we will use Convolutional Neural Networks(CNN) Xception architecture pre-trained model to predict “Sea Lion” and check how much accuracy shows.

We will compare Xception with ResNet50. VGG16 and VGG19 by Oxford Visual Geometry Group, MobileNetV3, NASNetMobile, and InceptionV3.

I am working on a few kinds of research projects on the Enterprise Resource Planning side and using Convolutional Neural Networks(CNN) Image Recognition and computer vision.

I have used Google Colab IDE for this example, and you can download it from the GitHub Repository.

 

Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Sealion 299 x 299
Copy to Clipboard
array([[[[0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         ...,
         [0.56078434, 0.7882353 , 0.64705884],
         [0.56078434, 0.7882353 , 0.64705884],
         [0.56078434, 0.7882353 , 0.64705884]],

        [[0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         ...,
         [0.56078434, 0.7882353 , 0.64705884],
         [0.56078434, 0.7882353 , 0.64705884],
         [0.56078434, 0.7882353 , 0.64705884]],

        [[0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         ...,
         [0.56078434, 0.7882353 , 0.64705884],
         [0.56078434, 0.7882353 , 0.64705884],
         [0.56078434, 0.7882353 , 0.64705884]],

        ...,

        [[0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         ...,
         [0.58431375, 0.8039216 , 0.6862745 ],
         [0.58431375, 0.8039216 , 0.6862745 ],
         [0.58431375, 0.8039216 , 0.6862745 ]],

        [[0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         ...,
         [0.58431375, 0.8039216 , 0.6862745 ],
         [0.58431375, 0.8039216 , 0.6862745 ],
         [0.58431375, 0.8039216 , 0.6862745 ]],

        [[0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         [0.5686275 , 0.7882353 , 0.67058825],
         ...,
         [0.58431375, 0.8039216 , 0.6862745 ],
         [0.58431375, 0.8039216 , 0.6862745 ],
         [0.58431375, 0.8039216 , 0.6862745 ]]]], dtype=float32)
Copy to Clipboard
array([[1.65983402e-05, 3.02803492e-05, 3.50116752e-04, 3.01038453e-05,
        4.61458694e-05, 3.75998003e-04, 7.98310648e-05, 2.02781830e-05,
        1.47803785e-05, 9.90990247e-06, 3.06817274e-05, 1.48114796e-05,
        1.05194113e-05, 6.75433330e-06, 1.55230518e-05, 5.23465724e-06,
        5.77932042e-06, 1.82516105e-05, 1.02387330e-05, 3.44797809e-05,
        4.72188094e-06, 2.18933910e-05, 2.25441681e-06, 1.87207843e-05,
        2.03071559e-05, 9.72123144e-06, 3.72341515e-06, 5.00199030e-06,
        3.16945602e-06, 2.45330484e-05, 2.83389891e-05, 4.18825266e-06,
        8.16215834e-06, 2.76689650e-04, 1.49350017e-04, 1.96279161e-05,
        1.13017450e-04, 7.80831670e-06, 7.22121604e-06, 9.95095797e-06,
        4.08249389e-06, 1.53590972e-05, 9.51577567e-06, 7.90108243e-06,
        4.41606016e-06, 7.70092356e-06, 1.14050654e-05, 4.38019833e-06,
        2.15328673e-05, 3.34810443e-06, 2.64500704e-06, 8.88301838e-06,
        2.70221499e-05, 1.30090784e-05, 8.80540483e-06, 1.13567548e-05,
        3.52756724e-05, 1.82357435e-05, 1.50531350e-05, 1.16213278e-05,
        2.10711605e-05, 1.88702052e-05, 7.02352190e-06, 1.38095165e-05,
        1.78636164e-05, 1.13213784e-04, 1.30413873e-05, 7.23763924e-06,
        7.75247463e-06, 7.79235324e-06, 8.02858358e-06, 1.48119725e-05,
        6.15026556e-06, 1.97427344e-05, 1.22003330e-05, 3.68293240e-06,
        1.18405978e-05, 1.65298588e-05, 2.74712947e-04, 2.04821645e-05,
        7.66333233e-06, 3.85026324e-05, 1.69485047e-05, 2.74948707e-05,
        2.75298080e-04, 3.47315581e-05, 4.35043039e-05, 8.48885247e-05,
        6.77698335e-05, 3.07185583e-05, 1.94551412e-05, 9.67139022e-06,
        1.18816706e-05, 7.14571570e-06, 7.14176858e-05, 3.04540517e-05,
        9.31754948e-06, 7.45574143e-05, 5.97966618e-06, 4.56709950e-06,
        1.08929703e-06, 4.65716857e-06, 1.25991191e-05, 1.12738751e-04,
        2.98804139e-06, 5.58311513e-06, 2.35897605e-05, 6.59053985e-05,
        1.89396360e-05, 1.59530300e-05, 8.80150128e-06, 4.24946229e-05,
        1.51491067e-05, 1.50197593e-04, 5.74150617e-05, 2.34314866e-05,
        2.29316738e-05, 5.49762917e-04, 2.33192986e-06, 9.97093412e-06,
        1.15357307e-05, 1.78642028e-06, 9.41692178e-06, 3.72773911e-06,
        2.24801370e-05, 9.16606732e-05, 4.75873640e-05, 8.66453411e-06,
        5.22983237e-06, 2.50909989e-06, 3.14425756e-06, 2.81365737e-06,
        5.07760205e-06, 4.13438102e-06, 2.70674036e-06, 4.83754684e-06,
        5.80628512e-06, 1.52725825e-05, 1.34064876e-05, 1.74757188e-05,
        1.12869075e-05, 6.38927168e-06, 9.99845361e-06, 3.16443061e-06,
        7.81829385e-06, 8.57934174e-06, 5.39547955e-06, 2.79201304e-05,
        3.71018141e-05, 6.98916556e-04, 9.68340278e-01, 1.91431263e-05,
        2.54817387e-05, 5.99623017e-05, 2.62145059e-05, 5.09439669e-05,
        7.03665282e-05, 2.50125540e-05, 1.19201113e-05, 9.45101965e-06,
        2.16058888e-05, 9.69771190e-06, 1.28352694e-05, 6.05840341e-06,
        1.29135788e-05, 9.67220149e-06, 8.05989930e-06, 6.26959536e-06,
        1.48543259e-05, 1.18656135e-05, 5.08931998e-06, 7.51157677e-06,
        5.18243723e-06, 9.30932003e-07, 4.79106075e-06, 1.25578172e-05,
        1.72640030e-05, 7.22131244e-06, 4.45489559e-06, 7.61981755e-06,
        5.88158400e-06, 1.74458310e-05, 8.71965949e-06, 5.70372640e-06,
        5.76532693e-06, 1.15858611e-05, 5.10326345e-06, 1.33076383e-05,
        4.21206596e-06, 2.52179507e-06, 1.28900283e-05, 1.60629497e-05,
        4.63688866e-06, 5.78299841e-06, 1.30512790e-05, 2.86108170e-05,
        2.83178906e-05, 5.28099918e-06, 8.05668606e-06, 9.98441828e-06,
        1.81519372e-05, 1.08003742e-05, 1.57960840e-05, 1.80807037e-05,
        2.95026421e-05, 6.17972091e-06, 4.44742864e-06, 4.62096832e-05,
        1.21505554e-05, 8.91872151e-06, 3.52706093e-06, 7.45975649e-06,
        8.36231811e-06, 2.90392363e-05, 2.76093797e-05, 3.96661744e-06,
        8.04120373e-06, 1.55946291e-05, 1.23829386e-05, 1.30825201e-05,
        7.61656338e-06, 1.01065143e-05, 6.38894880e-06, 7.09874712e-06,
        7.07119307e-06, 4.43898762e-06, 1.68177958e-05, 1.97857003e-06,
        1.10526289e-05, 1.24809876e-05, 1.66320096e-05, 1.66805385e-05,
        4.60041792e-06, 3.77055881e-06, 2.83388272e-05, 2.31820900e-06,
        8.09630728e-06, 1.16798165e-05, 1.21337298e-05, 1.02083914e-05,
        1.01307369e-05, 3.05037702e-06, 9.53879862e-06, 6.83583448e-06,
        1.79956041e-05, 2.43767445e-05, 4.64214963e-06, 6.03838180e-06,
        1.19968636e-05, 2.43591512e-05, 1.46407619e-05, 1.85954632e-05,
        5.43750639e-06, 8.72560668e-06, 8.43753878e-06, 4.17555884e-06,
        7.06638639e-06, 1.64505054e-05, 1.79337039e-05, 1.50280484e-05,
        1.23437349e-05, 6.34409207e-06, 7.49556239e-06, 7.66162157e-06,
        8.04842330e-06, 1.59360316e-05, 2.42498072e-06, 8.00981616e-06,
        2.10941016e-05, 5.55943461e-06, 4.11785823e-06, 3.51015547e-06,
        2.35207835e-06, 1.60974764e-06, 3.07364485e-06, 1.55604687e-06,
        3.11840540e-06, 3.92768379e-06, 5.56132227e-06, 1.25793804e-05,
        5.41594591e-06, 6.02616055e-05, 2.75522780e-05, 2.49823970e-05,
        3.23894274e-05, 4.43915524e-05, 2.92690038e-05, 1.19866045e-05,
        2.43368850e-05, 2.99444146e-05, 2.59383451e-05, 8.64198864e-06,
        2.60502220e-05, 4.33644391e-06, 5.46019419e-06, 2.82593078e-06,
        1.66480939e-04, 2.69436009e-06, 1.40399261e-05, 3.88016160e-05,
        8.74351554e-06, 5.01825270e-05, 1.46523971e-05, 5.78327399e-06,
        2.68728127e-05, 2.17951674e-05, 6.98226222e-06, 2.11843981e-05,
        3.63205836e-05, 5.74300102e-05, 3.48062276e-05, 6.45628734e-06,
        9.02512693e-06, 4.87961915e-06, 1.53815236e-05, 3.80778943e-06,
        4.21381192e-05, 1.71276442e-05, 1.09872190e-05, 2.29581074e-05,
        7.30847705e-06, 8.03412877e-06, 8.21631966e-06, 3.35379264e-06,
        5.69486438e-05, 5.95610391e-06, 5.76169659e-05, 7.21411243e-06,
        3.74776682e-05, 5.97510598e-06, 2.55848627e-05, 1.18943062e-04,
        2.54558472e-05, 8.40928333e-05, 8.05218224e-05, 4.59594739e-05,
        3.95984680e-05, 1.41703873e-04, 3.23085696e-05, 2.83585086e-05,
        2.10859143e-05, 1.31915731e-04, 3.18923267e-05, 6.24372933e-06,
        5.93332770e-05, 4.73382943e-06, 5.73590432e-06, 1.45536587e-05,
        3.06220795e-06, 8.34638377e-06, 8.10906567e-06, 9.54169263e-06,
        3.58750003e-06, 1.04948913e-05, 6.27686404e-06, 9.40846530e-06,
        9.04299959e-05, 7.97142784e-05, 3.23715176e-05, 5.89257979e-05,
        8.80462467e-04, 3.30074226e-06, 1.01246376e-04, 1.51241193e-05,
        8.50642100e-05, 3.02314984e-05, 4.84791508e-06, 8.67796462e-06,
        1.53610890e-05, 1.03589500e-05, 1.83492939e-05, 8.65348557e-06,
        3.82303915e-06, 2.99355497e-06, 1.75250389e-05, 1.41544961e-05,
        4.15800650e-06, 1.09904149e-05, 7.17774083e-06, 1.38021169e-05,
        3.20857725e-05, 4.81768075e-06, 2.26761658e-05, 6.82837435e-06,
        8.29664077e-06, 5.57651128e-06, 3.28349643e-06, 2.18555506e-05,
        1.25726046e-05, 6.03595208e-06, 5.81159547e-05, 1.32582982e-05,
        2.29817233e-05, 6.99216434e-06, 8.35855553e-06, 7.20214484e-06,
        4.84605480e-05, 4.56117140e-03, 9.40150494e-06, 6.83515009e-06,
        5.83680367e-06, 4.37630251e-06, 7.82482857e-06, 2.54091447e-06,
        1.31577062e-05, 3.81094469e-05, 8.45035174e-06, 1.05417357e-05,
        7.28604073e-06, 8.26174255e-06, 3.25309452e-06, 2.86055529e-05,
        5.37232081e-05, 2.57151578e-06, 5.22390064e-06, 1.95505640e-06,
        1.14807017e-05, 2.32528892e-05, 3.76537864e-05, 1.12414949e-04,
        7.29540579e-06, 3.35237128e-05, 9.69601933e-06, 2.93874950e-06,
        3.21132757e-06, 7.26761527e-06, 1.51865570e-05, 9.46889213e-06,
        1.07623209e-05, 6.45900354e-06, 3.83292490e-06, 1.20970917e-05,
        4.76272953e-06, 1.38766423e-04, 5.13109771e-05, 4.10923712e-05,
        4.12418558e-06, 2.23400857e-05, 2.24298765e-05, 4.87194166e-06,
        3.16134938e-05, 2.50756548e-05, 1.07040987e-05, 9.20524690e-06,
        5.79669722e-06, 1.18305179e-05, 7.04090507e-06, 2.58803775e-05,
        8.29814890e-05, 1.03688135e-05, 1.07947935e-05, 2.58062410e-05,
        2.98621570e-04, 1.49397374e-05, 1.29394293e-05, 1.27030344e-05,
        5.50720324e-06, 9.24692540e-06, 6.90757361e-06, 1.48151657e-05,
        1.13557489e-05, 1.46556249e-05, 1.57699706e-05, 1.18719123e-04,
        1.00857178e-05, 4.10929806e-06, 2.97150418e-05, 1.35750338e-06,
        7.03323440e-06, 2.35134612e-05, 1.78543341e-05, 4.91076898e-05,
        2.30221622e-06, 5.15956981e-06, 5.39132407e-06, 2.29116067e-05,
        1.19447823e-05, 6.81203574e-06, 1.44608121e-05, 2.90993939e-05,
        1.04223991e-05, 2.57255961e-05, 2.17537286e-06, 1.51234990e-05,
        7.52790675e-06, 1.63503182e-06, 7.75538047e-06, 8.31022135e-06,
        1.94941622e-05, 1.33858930e-05, 1.07890091e-05, 4.30865157e-06,
        5.11724556e-06, 2.73486194e-06, 2.61600380e-05, 4.23531174e-06,
        5.95082929e-06, 1.39468302e-05, 4.83096755e-06, 6.64004801e-06,
        1.40328048e-05, 3.82477174e-06, 1.34039683e-05, 5.63585418e-05,
        4.73462678e-05, 1.01575142e-05, 6.05257919e-05, 2.36731230e-05,
        9.27854944e-06, 3.68981227e-06, 6.71928001e-06, 2.18079640e-06,
        1.27539324e-05, 8.77101684e-06, 5.26141866e-06, 1.16065758e-05,
        2.62644153e-06, 7.97683151e-06, 3.89130473e-05, 1.83148004e-05,
        6.68619987e-06, 9.82907113e-06, 2.52125774e-05, 6.58902172e-06,
        7.63482421e-06, 7.80990376e-06, 6.20293213e-06, 1.57513623e-05,
        6.19328512e-06, 1.26975228e-05, 2.85289821e-06, 4.69847828e-06,
        7.85218890e-06, 6.80473750e-06, 2.63533343e-06, 7.34307332e-06,
        1.84736946e-05, 3.13872101e-06, 3.91183603e-05, 1.15369621e-05,
        5.48617209e-06, 1.45929698e-06, 4.14742863e-06, 1.03287739e-05,
        2.94380425e-06, 3.23963504e-05, 3.57449198e-06, 6.04530760e-06,
        1.97290024e-06, 2.27363198e-05, 4.14020451e-06, 2.71982444e-05,
        7.43897326e-05, 6.47169281e-06, 2.47567368e-06, 4.59853209e-06,
        9.70126848e-07, 3.65169944e-05, 1.07392625e-05, 7.22643108e-06,
        1.47117371e-05, 2.29869602e-05, 3.64640946e-05, 1.17987329e-05,
        5.73790658e-06, 4.92106165e-06, 1.45031981e-05, 4.64793948e-06,
        7.31492719e-06, 1.10273913e-05, 1.33045105e-04, 4.11213205e-06,
        3.01978689e-05, 4.80155813e-06, 2.00057875e-05, 5.16200635e-06,
        3.79089397e-06, 8.17332784e-06, 1.31999741e-05, 4.62477055e-06,
        9.37284040e-06, 7.33505931e-06, 8.16617558e-06, 1.07349515e-05,
        2.37925578e-05, 4.62915659e-06, 1.18667222e-05, 1.14412105e-05,
        1.25533152e-05, 4.60306655e-05, 6.85887971e-06, 1.17906120e-05,
        9.44374005e-06, 7.91959519e-06, 7.04271133e-06, 4.20553579e-06,
        1.56688020e-06, 2.87086255e-06, 3.16628098e-06, 7.48803132e-06,
        4.73001419e-05, 8.28440989e-06, 8.56123825e-06, 1.39408867e-05,
        9.11476309e-06, 5.14428984e-06, 5.80348433e-06, 1.27880949e-05,
        1.03024186e-05, 4.01618536e-06, 1.25566685e-05, 4.73118052e-06,
        6.77617891e-06, 2.87521630e-06, 1.30113740e-05, 7.29331214e-06,
        4.87265534e-05, 2.97941533e-05, 3.25990404e-05, 4.11686269e-05,
        7.73132160e-06, 6.47418028e-06, 1.67281869e-05, 1.42227891e-05,
        9.67797769e-06, 4.43909994e-05, 1.83160755e-05, 5.70064822e-06,
        5.35763138e-05, 8.16194733e-06, 2.77311756e-06, 6.42666555e-06,
        3.33504818e-06, 5.83399087e-05, 5.61325305e-06, 9.87688054e-06,
        5.00238139e-06, 5.52152824e-06, 2.98942109e-06, 5.88036710e-06,
        1.88226477e-05, 3.38208483e-05, 4.71693966e-06, 1.80536113e-03,
        2.35323951e-05, 5.51030826e-06, 7.19616146e-05, 1.04202718e-05,
        1.56498281e-05, 6.47691604e-06, 1.06558618e-05, 8.23740902e-06,
        1.74782199e-05, 8.95852281e-06, 4.61680747e-06, 9.55835912e-06,
        3.84539908e-06, 1.76703561e-05, 1.10331357e-05, 3.22985288e-05,
        1.23262662e-05, 3.30272610e-06, 7.36124775e-06, 1.46189823e-05,
        9.98801806e-06, 6.03614808e-06, 1.42148565e-05, 3.99697201e-05,
        1.86581528e-05, 7.04458580e-06, 3.56682995e-06, 6.22994185e-06,
        3.26431336e-06, 4.15387876e-05, 2.36984888e-05, 2.53303315e-05,
        2.55254454e-05, 3.09223979e-05, 3.57962585e-06, 2.17328779e-05,
        2.80263575e-05, 1.35694490e-05, 4.31394710e-06, 4.16518651e-06,
        3.53666779e-04, 1.43000204e-06, 2.33666397e-05, 3.75837726e-06,
        3.75578315e-06, 1.19831529e-05, 4.61314585e-06, 6.27581394e-05,
        9.92694822e-06, 2.39995165e-06, 7.44748741e-06, 1.81830892e-05,
        1.09344153e-04, 3.60730564e-06, 7.32870376e-06, 4.91748187e-06,
        5.63239919e-05, 1.92445877e-05, 4.61178206e-06, 1.09173943e-05,
        4.78988159e-06, 8.45852719e-06, 1.84542369e-05, 2.50549056e-05,
        9.64706123e-06, 2.32298703e-06, 1.12564976e-05, 7.22398499e-06,
        1.50206775e-04, 9.17318084e-06, 5.85046037e-05, 2.32787825e-05,
        6.10604775e-06, 2.27048804e-05, 1.39018803e-05, 2.15326925e-03,
        1.89266884e-05, 3.27023226e-05, 1.78439859e-05, 1.51578797e-05,
        7.46315800e-06, 7.98816254e-05, 1.90593221e-06, 1.86640264e-05,
        9.82744459e-05, 7.51531752e-06, 4.06048957e-06, 2.59392364e-05,
        2.19849699e-05, 2.76014835e-05, 8.85916143e-06, 1.26045152e-05,
        3.72829732e-06, 1.54448026e-05, 2.15991731e-05, 3.10151768e-06,
        3.48478461e-05, 1.00083462e-05, 2.50208427e-06, 5.15211359e-05,
        2.11578681e-05, 1.15799412e-05, 7.38719064e-06, 1.47383626e-05,
        1.30672452e-05, 1.38680422e-04, 4.05926221e-06, 3.18614548e-06,
        8.06577373e-06, 3.53450923e-06, 1.83996269e-06, 3.94102244e-06,
        7.17982621e-05, 1.00657408e-05, 5.08293169e-06, 3.67364714e-06,
        2.29014477e-05, 3.48240746e-06, 4.14753958e-06, 6.66786127e-06,
        4.40955409e-06, 1.79899926e-05, 5.99519763e-06, 1.38429950e-05,
        5.56027726e-06, 1.39362473e-05, 3.60847548e-06, 2.75285329e-05,
        3.60187987e-05, 5.66070812e-05, 3.56594910e-06, 6.57450346e-06,
        7.99081772e-06, 1.63463585e-06, 4.92812524e-06, 6.07251150e-06,
        8.92737626e-06, 2.81335952e-06, 5.05776325e-06, 3.99102973e-05,
        6.06472458e-05, 4.53967277e-06, 6.83162489e-06, 2.33467708e-05,
        1.25393933e-06, 4.17351657e-06, 9.03822729e-06, 1.32900732e-05,
        1.81316445e-05, 7.30276079e-05, 2.07007852e-05, 2.84792623e-06,
        1.55005964e-05, 3.30787361e-06, 1.07024662e-05, 1.75124078e-05,
        4.07410471e-06, 1.33024741e-05, 2.38178359e-06, 1.80862298e-06,
        4.20298784e-05, 1.71086103e-05, 6.17743535e-06, 1.24997005e-05,
        2.48173583e-05, 2.43331942e-05, 2.48161882e-06, 7.10804807e-06,
        1.72095588e-05, 9.69264511e-06, 1.67861083e-06, 1.25047563e-05,
        1.79347233e-04, 4.42927876e-06, 9.93967551e-05, 4.41379916e-06,
        2.87049556e-06, 4.43178033e-06, 5.66310291e-06, 5.44323984e-06,
        6.82001155e-06, 6.17301794e-06, 5.35650497e-06, 5.03396268e-06,
        7.91478960e-05, 8.72708006e-06, 1.54357476e-05, 3.59996830e-06,
        1.24019898e-05, 5.38674212e-05, 4.72885267e-06, 1.86716989e-05,
        1.24353173e-05, 9.82651272e-06, 1.06963435e-05, 8.49228127e-06,
        2.75154889e-05, 2.83566555e-06, 9.59763656e-06, 2.27382934e-05,
        2.66566185e-05, 7.98125620e-05, 1.37143516e-05, 9.31568320e-06,
        4.78204493e-06, 3.95825336e-05, 3.64411499e-05, 4.93884318e-06,
        2.04911321e-05, 5.48169510e-06, 2.61031050e-06, 8.54471582e-05,
        3.31612682e-06, 4.35054426e-06, 7.82337429e-06, 1.60672535e-05,
        3.37838878e-06, 2.71972585e-05, 5.34267383e-06, 1.14730610e-05,
        9.13533586e-06, 6.35510105e-06, 9.87699332e-06, 5.83947076e-06,
        1.66968039e-05, 9.75395687e-06, 1.44088999e-05, 1.95850498e-06,
        2.85293368e-06, 6.76804120e-06, 5.98553106e-06, 1.87422756e-05,
        1.73995722e-05, 6.94113260e-06, 3.37834376e-06, 5.61583374e-06,
        1.69900286e-05, 4.93906464e-06, 3.29881641e-06, 4.06461040e-05,
        1.48785412e-05, 2.90521575e-06, 6.23324058e-06, 8.77616276e-06,
        2.20589072e-06, 4.70841405e-06, 1.04324326e-05, 7.46386240e-06,
        1.13089736e-05, 2.75994043e-05, 4.37329027e-06, 8.19561228e-06,
        2.45051866e-04, 3.93271584e-05, 2.52187801e-05, 2.00633731e-05,
        1.91215604e-05, 6.69975489e-05, 1.92905263e-05, 5.09152633e-05,
        2.35884308e-05, 2.05309570e-05, 1.61497417e-06, 7.82334755e-05,
        5.69036092e-06, 2.73724036e-05, 4.28269914e-06, 8.38000960e-06,
        2.84026396e-06, 6.31747534e-05, 5.44477143e-06, 7.08292282e-06,
        9.74176965e-06, 5.35768504e-06, 1.98139387e-05, 3.03709430e-06,
        8.54568225e-06, 3.57346948e-06, 4.94908363e-06, 2.34943855e-05,
        1.78074595e-06, 1.59825886e-05, 3.36432549e-06, 1.00663365e-05,
        6.32118554e-06, 5.33060447e-05, 8.84173187e-06, 4.33160203e-05,
        6.57560713e-06, 5.14128806e-06, 5.00917486e-06, 5.00752230e-06,
        3.58475918e-05, 2.08952930e-04, 4.66551501e-05, 2.34075214e-05,
        2.13851908e-05, 2.98014584e-05, 4.87016041e-05, 3.49383590e-05,
        3.91068716e-05, 3.04496680e-05, 2.80150562e-05, 2.15844921e-05,
        1.46351857e-04, 2.31622580e-05, 7.80160281e-06, 2.03538038e-05,
        7.12425435e-06, 2.23648785e-05, 4.83019176e-05, 8.71380689e-06,
        7.93075451e-05, 2.72965208e-05, 7.79602487e-06, 1.17199170e-05,
        8.17126329e-06, 1.62598590e-05, 3.56876285e-06, 4.18981108e-06,
        5.88112425e-06, 4.91517994e-06, 5.28618148e-05, 1.27649328e-05,
        5.19994064e-05, 1.84776763e-05, 6.37496260e-06, 3.22680949e-04,
        5.40923565e-06, 1.47737683e-05, 4.52478253e-06, 2.73298997e-06,
        9.16030331e-06, 6.73434261e-06, 1.35692671e-05, 4.39103951e-06,
        5.97866847e-06, 2.94498363e-06, 1.67658472e-05, 6.78966971e-05,
        4.71447038e-06, 1.51047334e-05, 4.40034955e-06, 1.07245560e-05,
        6.21281579e-05, 1.49911175e-05, 2.63767070e-05, 1.34302309e-06,
        4.79672963e-06, 1.13071883e-06, 2.76882474e-05, 3.60243612e-05,
        3.32539321e-06, 3.82541339e-06, 1.53966976e-05, 6.77922653e-05]],
      dtype=float32)
Copy to Clipboard
[[('n02077923', 'sea_lion', 0.9683403),
  ('n02655020', 'puffer', 0.0045611714),
  ('n03935335', 'piggy_bank', 0.0021532692),
  ('n03724870', 'mask', 0.0018053611),
  ('n02444819', 'otter', 0.00088046247)]]

Looks nice! Xception pretrained model correctly predicted as “Sea Lion” with 0.968 prediction accuracy.

Let’s check the prediction accuracy on VGG19, VGG16, InceptionV3, MobileNetV3, NASNetMobile, and ResNet50.

VGG16:

[[('n02077923', 'sea_lion', 0.45364004),
  ('n02074367', 'dugong', 0.1379553),
  ('n01664065', 'loggerhead', 0.07919356),
  ('n01665541', 'leatherback_turtle', 0.0403896),
  ('n02808304', 'bath_towel', 0.018666666)]]
VGG19:
[[('n02077923', 'sea_lion', 0.8721129),
  ('n01664065', 'loggerhead', 0.048861112),
  ('n01665541', 'leatherback_turtle', 0.01896045),
  ('n02074367', 'dugong', 0.016715886),
  ('n02444819', 'otter', 0.006451091)]]
InceptionV3:
[[('n02077923', 'sea_lion', 0.7158504),
  ('n02444819', 'otter', 0.10402603),
  ('n01665541', 'leatherback_turtle', 0.0068784873),
  ('n02808440', 'bathtub', 0.0035360176),
  ('n01784675', 'centipede', 0.0034717675)]]
MobileNetV3:
[[('n02077923', 'sea_lion', 0.25503463),
  ('n03724870', 'mask', 0.12915507),
  ('n03935335', 'piggy_bank', 0.12580934),
  ('n02134084', 'ice_bear', 0.0388209),
  ('n01484850', 'great_white_shark', 0.033164274)]]

ResNet50:

[[('n02077923', 'sea_lion', 0.50293046),
  ('n01484850', 'great_white_shark', 0.39009607),
  ('n02808440', 'bathtub', 0.028271727),
  ('n02655020', 'puffer', 0.0064766705),
  ('n04493381', 'tub', 0.0058223144)]]

NASNetMobile:

[[('n02077923', 'sea_lion', 0.57366097),
  ('n04131690', 'saltshaker', 0.0431055),
  ('n03935335', 'piggy_bank', 0.041847255),
  ('n04423845', 'thimble', 0.016428046),
  ('n03724870', 'mask', 0.012995369)]]
In this example, we could see ALL pretrained models predicts as "Sea Lion".
By |2021-05-29T21:52:20+00:00May 27th, 2021|Artificial Intelligence, Machine Learning|0 Comments

About the Author:

Leave A Comment