Day 36 – Predict An Image Using InceptionV3 Pre-trained Model

Image Source: Pexels

We have already gone through Convolutional Neural Networks – Layers, Filters, and Architectures, Predict Image Using ResNet50 Pretrained Model, and Predict An Image Using VGG19 Pretrained Model one of the 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, etc. models to check how it predicts. Today, we will use Convolutional Neural Networks(CNN) InceptionV3 architecture pre-trained model to predict “Boathouse” and check how much accuracy shows.  We can also compare and see with ResNet50. VGG16, and VGG19 by Oxford Visual Geometry Group and won the ILSVRC challenge in 2016.

I am working on a few kinds of research 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
boathouse 299 x 299
Copy to Clipboard
array([[[[ 0.79607844,  0.81960785,  0.67058825],
         [ 0.79607844,  0.81960785,  0.67058825],
         [ 0.7882353 ,  0.8117647 ,  0.6627451 ],
         ...,
         [ 0.7490196 ,  0.78039217,  0.6627451 ],
         [ 0.7490196 ,  0.78039217,  0.6627451 ],
         [ 0.7490196 ,  0.78039217,  0.6627451 ]],

        [[ 0.79607844,  0.81960785,  0.67058825],
         [ 0.79607844,  0.81960785,  0.67058825],
         [ 0.7882353 ,  0.8117647 ,  0.6627451 ],
         ...,
         [ 0.7490196 ,  0.78039217,  0.6627451 ],
         [ 0.7490196 ,  0.78039217,  0.6627451 ],
         [ 0.7490196 ,  0.78039217,  0.6627451 ]],

        [[ 0.79607844,  0.81960785,  0.67058825],
         [ 0.79607844,  0.81960785,  0.67058825],
         [ 0.7882353 ,  0.8117647 ,  0.6627451 ],
         ...,
         [ 0.7490196 ,  0.78039217,  0.6627451 ],
         [ 0.7490196 ,  0.78039217,  0.6627451 ],
         [ 0.7490196 ,  0.78039217,  0.6627451 ]],

        ...,

        [[-0.60784316, -0.6392157 , -0.92941177],
         [-0.6392157 , -0.6862745 , -0.96862745],
         [-0.62352943, -0.6862745 , -0.96862745],
         ...,
         [-0.04313725, -0.01176471, -0.12941176],
         [-0.05098039, -0.01960784, -0.1372549 ],
         [-0.05098039, -0.01960784, -0.1372549 ]],

        [[-0.5921569 , -0.6392157 , -0.92156863],
         [-0.6       , -0.6627451 , -0.94509804],
         [-0.5372549 , -0.6156863 , -0.8901961 ],
         ...,
         [-0.04313725, -0.01176471, -0.12941176],
         [-0.05098039, -0.01960784, -0.1372549 ],
         [-0.05098039, -0.01960784, -0.1372549 ]],

        [[-0.6313726 , -0.6784314 , -0.9607843 ],
         [-0.6       , -0.6627451 , -0.94509804],
         [-0.4823529 , -0.56078434, -0.8352941 ],
         ...,
         [-0.04313725, -0.01176471, -0.12941176],
         [-0.05098039, -0.01960784, -0.1372549 ],
         [-0.05098039, -0.01960784, -0.1372549 ]]]], dtype=float32)
Copy to Clipboard
array([[7.93242871e-05, 1.58672789e-04, 1.65201258e-04, 6.17119804e-05,
        1.50497523e-04, 8.15498279e-05, 7.70324259e-05, 5.63759750e-05,
        9.00740342e-05, 4.85937053e-05, 1.63986173e-04, 1.79541938e-04,
        2.05844190e-04, 4.05590690e-05, 2.89637130e-04, 9.84248254e-05,
        1.21721714e-04, 8.76354970e-05, 6.85585692e-05, 5.15232605e-05,
        6.00928943e-05, 7.81590061e-05, 5.47572745e-05, 1.11831680e-04,
        4.28025705e-05, 1.08352535e-04, 2.05621080e-04, 1.94192224e-04,
        1.17842807e-04, 8.75356782e-05, 2.43818780e-04, 3.04753426e-04,
        2.97659048e-04, 3.46931702e-05, 3.58913203e-05, 8.83304092e-05,
        1.57254690e-04, 1.12707057e-04, 2.34034102e-04, 2.27103548e-04,
        1.28687519e-04, 2.07778299e-04, 8.99510196e-05, 8.63383248e-05,
        1.22158395e-04, 9.54222778e-05, 1.29687818e-04, 2.28606179e-04,
        1.09342414e-04, 1.00372592e-04, 2.55030056e-04, 4.73609143e-05,
        8.38785199e-05, 8.90316878e-05, 9.25165295e-05, 6.62032544e-05,
        5.20185167e-05, 8.49057105e-05, 1.61434175e-04, 6.17487167e-05,
        7.22031327e-05, 8.67163399e-05, 8.36884356e-05, 4.74300650e-05,
        6.91479654e-05, 1.01977836e-04, 7.93447180e-05, 3.98421216e-05,
        1.46626073e-04, 7.84824879e-05, 9.20913517e-05, 3.68368754e-04,
        9.77431118e-05, 2.59137392e-04, 7.65493023e-05, 2.23597031e-04,
        1.19395074e-04, 1.11316469e-04, 1.40412900e-04, 1.00216304e-04,
        6.15871613e-05, 5.08432204e-05, 1.22548590e-04, 1.51855696e-04,
        2.40665991e-04, 9.72793569e-05, 1.42866935e-04, 1.47122613e-04,
        1.21435558e-04, 1.16303177e-04, 2.92573328e-04, 9.11837924e-05,
        1.08919351e-03, 1.21014855e-04, 1.16754149e-04, 1.87279962e-04,
        2.45764124e-04, 2.23227689e-04, 8.13994047e-05, 1.68220111e-04,
        2.22275979e-04, 5.47128548e-05, 6.89875742e-05, 1.01058387e-04,
        1.42671764e-04, 6.71535163e-05, 7.67261809e-05, 1.85437151e-04,
        1.01876940e-04, 1.31406559e-04, 1.11072462e-04, 1.28557615e-04,
        1.63014527e-04, 4.72523207e-05, 3.71033457e-05, 1.30527013e-04,
        1.17574520e-04, 1.76628222e-04, 1.54373047e-04, 9.43184859e-05,
        1.52703520e-04, 1.56243477e-04, 1.31569075e-04, 1.01007514e-04,
        1.42733406e-04, 8.87204515e-05, 8.80722582e-05, 6.10768329e-05,
        6.15031749e-05, 7.89406186e-05, 9.90944754e-05, 1.15422758e-04,
        1.47802784e-04, 1.01926111e-04, 7.58018505e-05, 1.46849197e-04,
        3.40353174e-04, 3.63004765e-05, 7.00718374e-05, 3.69822810e-05,
        7.08884909e-05, 8.59076972e-05, 9.77943928e-05, 3.86490246e-05,
        2.93249352e-04, 1.08032989e-04, 7.76504530e-05, 7.18939991e-05,
        2.70641351e-04, 7.27890001e-05, 6.99083379e-04, 4.20211727e-04,
        1.21049146e-04, 1.54486086e-04, 9.81291305e-05, 2.37349450e-04,
        8.59303982e-05, 6.73849790e-05, 1.15751034e-04, 2.00485752e-04,
        1.08724547e-04, 1.04083323e-04, 1.61560165e-04, 1.55807793e-04,
        9.27189685e-05, 1.64299490e-04, 2.91347940e-04, 3.90743575e-04,
        1.84180157e-04, 4.71959793e-05, 6.75972551e-05, 8.27663025e-05,
        7.59743925e-05, 1.03359562e-04, 8.42294612e-05, 1.24042592e-04,
        5.63871072e-05, 8.83992616e-05, 1.46091974e-04, 8.68073548e-05,
        1.15056791e-04, 1.03923834e-04, 2.12093379e-04, 7.11933608e-05,
        8.82657405e-05, 8.16496686e-05, 5.07340519e-05, 2.35889223e-04,
        1.58223236e-04, 1.00715391e-04, 2.15110020e-04, 9.33484553e-05,
        1.29348802e-04, 1.42476929e-04, 1.90539955e-04, 6.69784567e-05,
        2.07456062e-04, 9.71795816e-05, 1.26237122e-04, 6.05971400e-05,
        2.85980874e-04, 1.41529206e-04, 2.22886069e-04, 1.80936026e-04,
        8.36045947e-05, 1.01412319e-04, 1.72887230e-04, 1.24889630e-04,
        1.70984116e-04, 2.28453166e-04, 1.16154988e-04, 2.16364235e-04,
        3.36218582e-05, 8.21204085e-05, 1.40667689e-04, 1.98698137e-04,
        3.77068754e-05, 8.08038531e-05, 5.73243087e-05, 5.94529738e-05,
        5.08408484e-05, 1.15362345e-04, 7.66681042e-05, 1.70218394e-04,
        1.32861358e-04, 1.23558872e-04, 3.34074924e-04, 7.01043828e-05,
        1.62706609e-04, 8.47184638e-05, 6.59277357e-05, 7.14861162e-05,
        4.10141583e-05, 8.07554679e-05, 1.82787451e-04, 3.04194924e-04,
        1.46249426e-04, 9.21047904e-05, 5.69785370e-05, 3.97126896e-05,
        3.44486980e-05, 3.37513266e-05, 4.89756712e-05, 1.67067163e-04,
        7.69446851e-05, 1.76237358e-04, 1.04453829e-04, 6.36526529e-05,
        1.80975723e-04, 9.48021261e-05, 1.34859962e-04, 7.21587348e-05,
        2.34198873e-04, 1.54095265e-04, 1.09314366e-04, 4.81545212e-05,
        1.35246533e-04, 8.66116170e-05, 6.50302754e-05, 2.78701365e-04,
        1.97787449e-04, 1.15793206e-04, 4.29843378e-04, 8.01189308e-05,
        5.01611503e-05, 7.33761917e-05, 8.29590426e-05, 7.84143413e-05,
        1.06255691e-04, 1.21315185e-04, 1.03000893e-04, 5.80502165e-05,
        2.55789317e-04, 1.15590252e-03, 4.21359640e-04, 5.24968964e-05,
        1.26489045e-04, 3.74221767e-04, 6.69422268e-04, 7.61330084e-05,
        3.10440548e-04, 1.31184061e-04, 1.29900276e-04, 7.64452052e-05,
        2.12516738e-04, 2.37615794e-04, 1.12344242e-04, 1.70902611e-04,
        4.82842006e-05, 3.04394271e-05, 9.07463909e-05, 8.52430603e-05,
        5.01642608e-05, 4.24584403e-04, 5.92160468e-05, 7.65453660e-05,
        8.48929121e-05, 7.52071574e-05, 5.98765444e-04, 5.03311458e-04,
        1.84606601e-04, 1.25407125e-04, 3.27176676e-04, 1.43850062e-04,
        2.96859740e-04, 2.51798541e-04, 1.83696611e-04, 3.59766331e-04,
        1.32856730e-04, 4.96000685e-05, 1.67341277e-04, 1.89921673e-04,
        2.98792555e-04, 4.81461175e-05, 1.35430717e-04, 8.08140248e-05,
        1.79394323e-04, 1.59310977e-04, 1.09928245e-04, 5.57168387e-05,
        9.49995956e-05, 9.77013551e-05, 9.59242898e-05, 1.70530504e-04,
        5.22772207e-05, 7.82345451e-05, 1.26931380e-04, 1.47606203e-04,
        6.58006611e-05, 1.77560665e-04, 1.14769995e-04, 4.78519687e-05,
        7.71092382e-05, 4.15458126e-05, 9.91274646e-05, 1.20906654e-04,
        1.06990861e-04, 1.44383346e-04, 4.82239629e-05, 1.00821482e-04,
        9.86631640e-05, 2.23386567e-04, 1.73635824e-04, 7.64828292e-05,
        3.57520403e-05, 8.61980516e-05, 1.90010440e-04, 5.01910581e-05,
        8.21359936e-05, 7.57111120e-05, 4.75051202e-05, 8.35719911e-05,
        1.15805356e-04, 2.46937881e-04, 1.50741136e-04, 8.51345176e-05,
        2.89157848e-04, 4.99843736e-05, 3.48519126e-04, 1.55798582e-04,
        3.28285591e-04, 5.90577438e-05, 7.19809614e-04, 7.98719775e-05,
        2.99841311e-04, 4.97941037e-05, 9.40544924e-05, 7.38390081e-05,
        8.02241339e-05, 1.07139123e-04, 1.17850563e-04, 6.07890179e-05,
        5.83918008e-05, 2.83685804e-04, 2.23114665e-04, 1.18107993e-04,
        1.70046318e-04, 1.11337598e-04, 1.54628986e-04, 1.56975089e-04,
        8.46717812e-05, 6.35171891e-05, 1.64754121e-04, 8.94217519e-05,
        1.18961470e-04, 1.12470843e-04, 6.97732903e-05, 1.56283204e-04,
        1.05960513e-04, 2.24630741e-04, 9.15561250e-05, 8.72642922e-05,
        8.97728532e-05, 8.56616098e-05, 3.16755497e-04, 1.94841326e-04,
        2.81803281e-04, 2.61976063e-04, 1.84431497e-04, 2.06300596e-04,
        6.04211382e-05, 8.70304139e-05, 1.61385615e-04, 1.87183102e-03,
        2.84258189e-04, 2.89330259e-04, 3.31851508e-04, 6.45539330e-05,
        6.08100381e-04, 1.24245620e-04, 1.95826011e-04, 1.40285614e-04,
        4.27437044e-04, 5.00442329e-05, 7.00643504e-05, 2.35084899e-05,
        8.62617817e-05, 3.17603815e-04, 9.96453600e-05, 1.22643993e-04,
        1.12595444e-04, 5.93809818e-04, 3.74334923e-05, 3.07359325e-04,
        1.96519060e-04, 1.35494804e-04, 1.09181732e-04, 7.34858622e-05,
        2.10246973e-04, 1.24100086e-04, 2.71290592e-05, 2.66566261e-04,
        4.83081494e-05, 3.20003572e-04, 1.03873201e-04, 8.27885669e-05,
        4.63404576e-04, 9.13655036e-04, 1.31556837e-04, 7.85245720e-05,
        1.60487834e-04, 2.01886767e-04, 2.10299133e-03, 3.89320834e-04,
        7.97646499e-05, 2.06038807e-04, 4.97505353e-05, 2.20164700e-04,
        2.55734776e-04, 2.52787828e-01, 1.08663698e-04, 2.20766131e-04,
        7.23827980e-05, 2.04734504e-04, 1.35015987e-04, 1.17061303e-04,
        4.80932977e-05, 2.07504447e-04, 2.29091995e-04, 7.29298481e-05,
        2.56137294e-03, 5.02034090e-05, 3.08525050e-05, 2.66699262e-05,
        4.61684649e-05, 5.56713712e-05, 4.35405935e-04, 5.53406353e-05,
        2.25460681e-04, 8.66278933e-05, 2.02214156e-04, 2.61746551e-04,
        4.43760742e-04, 5.28321718e-04, 9.34333366e-05, 9.39196907e-05,
        8.23109760e-04, 5.89088486e-05, 1.49100219e-04, 4.20143006e-05,
        6.99778029e-05, 6.05746063e-05, 6.28847483e-05, 1.06458564e-03,
        8.85699317e-03, 2.26650896e-04, 9.73295610e-05, 1.07550761e-04,
        2.28936377e-04, 1.34451140e-04, 1.07903346e-04, 6.21619620e-05,
        6.06816284e-05, 5.15928878e-05, 1.19254531e-04, 1.61120959e-04,
        1.07521009e-04, 9.84403188e-04, 8.67878189e-05, 3.44784785e-05,
        1.05974759e-04, 1.02524500e-04, 3.62225946e-05, 2.15001841e-04,
        6.35148826e-05, 2.03588075e-04, 7.35296780e-05, 9.16185672e-05,
        1.52564869e-04, 2.17197798e-04, 6.08143583e-03, 1.90953229e-04,
        1.09563698e-04, 5.44596987e-05, 5.10845821e-05, 8.72373348e-05,
        3.39567458e-04, 8.23678682e-04, 5.13096165e-05, 9.07206850e-05,
        2.05248260e-04, 3.07195354e-04, 4.47356761e-05, 1.18177959e-04,
        1.45810249e-04, 1.44009234e-03, 1.35256792e-04, 3.37034653e-05,
        2.14841057e-04, 8.50478464e-05, 1.93772750e-04, 9.66121152e-05,
        1.79564115e-04, 9.83987411e-05, 2.18973757e-04, 5.02087241e-05,
        3.69782656e-01, 7.62173513e-05, 5.22615947e-03, 6.60756486e-05,
        2.13911128e-03, 1.07442807e-04, 4.88316982e-05, 4.59840812e-05,
        2.38155961e-04, 1.72140950e-04, 8.63015230e-05, 1.43854530e-04,
        1.45135244e-04, 8.40980647e-05, 7.56633308e-05, 2.39082045e-04,
        1.53844769e-04, 3.85675812e-05, 8.07512458e-03, 7.38192903e-05,
        1.04336352e-04, 6.54901785e-04, 9.78554090e-05, 1.77279289e-04,
        5.09256206e-05, 1.13201619e-04, 1.63989840e-03, 1.06808584e-04,
        2.29355312e-04, 1.59588031e-04, 9.80234327e-05, 1.92003514e-04,
        6.31814619e-05, 3.81189093e-05, 1.90573919e-04, 2.55255261e-04,
        1.04949388e-04, 1.27094550e-04, 3.64953121e-05, 2.29703568e-04,
        1.28194755e-02, 1.10149245e-04, 1.46944745e-04, 2.08713202e-04,
        5.40603243e-04, 7.43496785e-05, 9.90456392e-05, 1.07288608e-04,
        7.01036479e-05, 1.87650396e-04, 6.88874497e-05, 3.88984008e-05,
        9.15399723e-05, 1.93806656e-04, 1.66989907e-04, 8.62745292e-05,
        2.94901751e-04, 8.59593201e-05, 1.88135004e-04, 6.56119228e-05,
        2.74191243e-05, 1.43655881e-04, 7.75873777e-05, 1.10407018e-04,
        4.03368831e-05, 1.35239447e-04, 8.76482809e-05, 2.60077562e-04,
        1.74559376e-04, 6.74761031e-05, 6.59861689e-05, 7.66363082e-05,
        9.03215114e-05, 1.29247142e-04, 8.73114113e-05, 1.56423208e-04,
        2.59487802e-04, 1.61815813e-04, 1.82432370e-04, 2.87937564e-05,
        3.73027782e-04, 2.98251369e-04, 1.16470896e-04, 8.28232296e-05,
        6.11962460e-05, 5.12653060e-05, 1.29346648e-04, 1.96939611e-04,
        1.44349746e-04, 2.52621644e-03, 8.08066252e-05, 5.73115714e-04,
        7.15848338e-03, 1.84865654e-04, 5.75674931e-05, 2.53182050e-04,
        8.85848349e-05, 9.17344223e-05, 3.18728329e-04, 1.45080994e-04,
        5.61560773e-05, 1.19171535e-04, 2.76915438e-04, 1.76893722e-04,
        1.20414377e-04, 7.80218179e-05, 1.14087838e-04, 1.62477736e-04,
        7.12875262e-05, 1.21486752e-04, 1.22370839e-04, 1.08539309e-04,
        9.93978319e-05, 6.46414192e-05, 3.67769535e-05, 1.49519081e-04,
        1.25611332e-04, 1.21798585e-04, 2.79783388e-04, 6.27829941e-05,
        1.23248057e-04, 8.58248241e-05, 1.39000418e-04, 1.01718695e-04,
        2.08880170e-04, 1.76327725e-04, 1.77490496e-04, 1.54056773e-03,
        3.74613854e-04, 9.45384891e-05, 3.82648177e-05, 9.54534917e-05,
        4.53341193e-03, 1.66487036e-04, 1.11228706e-04, 4.16135808e-05,
        8.02574214e-05, 1.08378161e-04, 5.14686508e-05, 1.62984361e-04,
        5.93861623e-05, 1.45735939e-05, 2.32346414e-04, 6.07901165e-05,
        7.98999798e-04, 1.43057274e-04, 1.25731365e-03, 7.01789031e-05,
        9.53198687e-05, 9.11580501e-05, 1.13611735e-04, 2.00951778e-04,
        1.03342209e-04, 1.81513722e-04, 2.20463582e-04, 4.51445012e-05,
        4.69780098e-05, 4.73889260e-04, 1.25645120e-02, 1.17460761e-04,
        1.56655718e-04, 3.65676562e-04, 1.33146504e-02, 9.36434153e-05,
        1.75774010e-04, 2.16210552e-04, 9.74798531e-05, 7.26590981e-04,
        9.66543157e-05, 3.50906077e-04, 2.19429587e-03, 1.35525435e-04,
        2.13409076e-03, 3.07763039e-05, 8.36677646e-05, 1.54462585e-04,
        1.91476342e-04, 4.74414264e-05, 1.27004154e-04, 1.06490341e-04,
        3.40374594e-04, 2.05418328e-04, 6.30491078e-02, 1.74127505e-04,
        2.11639286e-04, 4.23357487e-05, 1.83412863e-04, 1.40167860e-04,
        1.08570792e-03, 8.06384196e-05, 7.04120612e-05, 2.13136402e-04,
        1.15736904e-04, 2.24936433e-04, 5.14763124e-05, 1.31694236e-04,
        1.31897221e-04, 2.76294479e-04, 1.09983499e-04, 1.82928547e-04,
        1.63801582e-04, 1.86170029e-04, 1.09683409e-04, 7.52682099e-05,
        1.27670064e-04, 1.68004393e-04, 3.77346441e-04, 9.02212123e-05,
        7.51624102e-05, 3.03664765e-05, 2.53214021e-05, 9.76604642e-05,
        6.54539908e-05, 6.95340204e-05, 8.46595067e-05, 9.48742090e-05,
        6.79778968e-05, 8.12707149e-05, 1.97808095e-05, 4.65995327e-05,
        2.11873834e-04, 9.51794354e-05, 2.06573881e-04, 6.00450039e-05,
        7.71858977e-05, 1.37436058e-04, 1.84355804e-03, 1.09793706e-04,
        3.92082329e-05, 1.60241601e-04, 1.93467436e-04, 1.00398545e-04,
        7.75115041e-05, 6.31864023e-05, 7.64682482e-05, 1.15285358e-04,
        6.81872916e-05, 4.44926700e-04, 7.33536654e-05, 5.19258552e-04,
        7.05507991e-05, 1.23141624e-04, 1.41262222e-04, 8.16999163e-05,
        5.86912734e-03, 2.49704230e-04, 1.45184735e-04, 2.63233633e-05,
        4.40183503e-05, 1.66982747e-04, 1.35884169e-04, 5.94450394e-05,
        8.83552639e-05, 8.50891447e-05, 6.42418236e-05, 1.35753406e-04,
        2.70365163e-05, 8.68851275e-05, 7.69264952e-05, 7.63451026e-05,
        4.99878515e-05, 8.29135606e-05, 1.54687834e-04, 1.97556510e-04,
        2.15304593e-04, 1.89018465e-04, 1.85933066e-04, 9.14589036e-05,
        1.15790332e-04, 9.59920071e-05, 1.88824168e-04, 2.81514804e-04,
        2.11245570e-04, 8.64429530e-05, 4.86377976e-05, 8.99740116e-05,
        2.34432169e-04, 2.70986115e-04, 4.42890218e-03, 7.80090995e-05,
        7.11929533e-05, 4.60458723e-05, 2.65505136e-04, 4.30141255e-04,
        1.85298981e-04, 5.14478469e-03, 2.00506503e-04, 4.58142022e-05,
        1.32883535e-04, 7.02303223e-05, 1.22115409e-04, 1.72633416e-04,
        6.95762792e-05, 5.81885688e-04, 3.67187422e-05, 2.25242955e-04,
        8.08661396e-04, 2.20039813e-03, 1.54953901e-04, 5.92340948e-04,
        2.31951344e-04, 6.39193386e-05, 3.80235288e-04, 1.23591814e-03,
        1.35089344e-04, 2.60646309e-04, 9.75705334e-05, 2.35377214e-04,
        1.37022507e-04, 1.18114753e-04, 2.98310391e-04, 1.02191530e-04,
        8.94897457e-05, 4.76151581e-05, 6.07858856e-05, 7.11279426e-05,
        1.05035208e-04, 7.99374771e-04, 2.19108188e-04, 6.51957598e-05,
        1.39598895e-04, 4.47719154e-04, 9.81485005e-04, 1.61101911e-04,
        4.87516430e-04, 3.26192618e-04, 7.29328312e-05, 2.64085160e-04,
        7.35988506e-05, 9.75292278e-05, 4.46013655e-05, 4.32591878e-05,
        2.33176179e-04, 1.67922626e-04, 7.83864452e-05, 1.95596996e-03,
        7.66113881e-05, 5.06676151e-04, 1.60827185e-04, 1.35818424e-04,
        4.08470922e-04, 1.34132002e-04, 9.88665124e-05, 1.24618426e-04,
        8.10063138e-05, 1.51746615e-04, 6.29837814e-05, 4.15148024e-05,
        8.91927746e-04, 8.94289115e-05, 1.00490783e-04, 3.83034640e-04,
        2.24972682e-04, 1.55558228e-04, 1.77595139e-04, 2.77769082e-04,
        1.71616426e-04, 2.47408498e-05, 4.73287182e-05, 5.45402581e-05,
        9.18308724e-05, 1.21356949e-04, 4.09687549e-04, 1.91560524e-04,
        1.65631296e-04, 2.76262581e-04, 5.11135331e-05, 2.00243841e-04,
        1.56143084e-04, 2.20407252e-04, 1.76982488e-04, 1.38699237e-04,
        1.38782198e-04, 2.46689800e-04, 1.22134981e-04, 1.04719446e-04,
        8.74271354e-05, 2.98329600e-04, 9.90920234e-04, 4.02164820e-04,
        1.26431827e-04, 4.36491027e-05, 1.44237929e-04, 1.56473499e-04,
        2.01803210e-04, 1.17284137e-04, 1.19987140e-04, 1.98788082e-04,
        1.06318337e-04, 1.60879965e-04, 2.72858568e-04, 9.27639048e-05,
        9.63252533e-05, 1.27261621e-04, 1.16266805e-04, 1.28503685e-04,
        2.16760149e-04, 1.80001502e-04, 1.60492113e-04, 1.24236030e-04,
        9.36595898e-05, 7.42628690e-05, 1.10512992e-04, 7.72708954e-05,
        2.84064561e-04, 4.29948923e-05, 1.46841150e-04, 6.16762118e-05,
        5.84873305e-05, 4.42846285e-05, 7.80405026e-05, 3.39752238e-04,
        7.10089298e-05, 6.12426011e-05, 4.87278667e-05, 1.07702668e-04,
        4.01234902e-05, 8.03979128e-05, 6.16903271e-05, 5.81298846e-05,
        5.20018984e-05, 1.01056270e-04, 5.90567324e-05, 2.39513582e-04,
        2.03253745e-04, 1.04323917e-04, 1.04778075e-04, 1.35995666e-04,
        2.50499084e-04, 1.62745549e-04, 7.43418786e-05, 9.07244103e-05,
        7.44189165e-05, 2.03419942e-04, 1.39388896e-04, 9.45961146e-05,
        3.52874777e-04, 3.38318438e-04, 6.15427198e-05, 3.68765220e-02,
        3.69821239e-04, 7.43500772e-04, 4.06701770e-03, 2.47952150e-04,
        1.34243135e-04, 1.30182350e-04, 2.91582808e-04, 1.84897406e-04,
        2.16834800e-04, 1.22418918e-04, 9.65665167e-05, 1.17880569e-04,
        1.30058004e-04, 8.96655547e-05, 4.02025034e-05, 1.91704734e-04,
        1.48628038e-04, 8.97410064e-05, 7.33409397e-05, 2.48315831e-04,
        1.64935846e-04, 1.48335079e-04, 1.73286273e-04, 8.32612568e-05]],
      dtype=float32)
Copy to Clipboard
[[('n03216828', 'dock', 0.36978266),
  ('n02859443', 'boathouse', 0.25278783),
  ('n03933933', 'pier', 0.06304911),
  ('n09332890', 'lakeside', 0.036876522),
  ('n03877845', 'palace', 0.01331465)]]

Wow! it predicted two things here as “dock” with 0.369 prediction accuracy and “boathouse” with 0.25 prediction accuracy.

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

VGG16:

[('n03216828', 'dock', 0.6446606),
  ('n03447447', 'gondola', 0.18577594),
  ('n03933933', 'pier', 0.03848932),
  ('n02894605', 'breakwater', 0.029645536),
  ('n02859443', 'boathouse', 0.027358243)]]
VGG19:
[[('n03447447', 'gondola', 0.41522947),
  ('n03216828', 'dock', 0.2927551),
  ('n02859443', 'boathouse', 0.12971269),
  ('n09332890', 'lakeside', 0.0425403),
  ('n03095699', 'container_ship', 0.021784496)]]

ResNet50:

[[('n03216828', 'dock', 0.7621628),
  ('n03947888', 'pirate', 0.065857835),
  ('n03095699', 'container_ship', 0.033779334),
  ('n04147183', 'schooner', 0.012518705),
  ('n03673027', 'liner', 0.010020729)]]
In this example, InceptionV3 pretrained model predicts better than above three models.
By |2021-05-29T21:54:03+00:00May 24th, 2021|Artificial Intelligence, Machine Learning|0 Comments

About the Author:

Leave A Comment