{"id":1334,"date":"2021-01-06T08:23:13","date_gmt":"2021-01-06T01:23:13","guid":{"rendered":"http:\/\/www.miai.vn\/?p=1334"},"modified":"2021-01-06T08:23:13","modified_gmt":"2021-01-06T01:23:13","slug":"nhin-doi-theo-cach-cua-mang-cnn-visualize-feature-maps-heatmap","status":"publish","type":"post","link":"https:\/\/miai.vn\/?p=1334","title":{"rendered":"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap)"},"content":{"rendered":"\n<p>Hello anh em, ch\u00fang ta \u0111\u00e3 l\u00e0m vi\u1ec7c v\u1edbi m\u1ea1ng CNN \u0111\u00e3 l\u00e2u l\u1eafm r\u1ed3i, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).<\/p>\n\n\n\n<p>Ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u xem khi ta \u0111\u01b0a m\u1ed9t v\u00e0o m\u1ea1ng m\u1ed9t h\u00ecnh \u1ea3nh (m\u1ed9t c\u00f4 g\u00e1i ch\u1eb3ng h\u1ea1n) th\u00ec \u00f4ng CNN \u00f4ng \u1ea5y nh\u00ecn th\u1ea5y c\u00f4 g\u00e1i \u0111\u00f3 nh\u01b0 n\u00e0o? C\u00f3 nh\u01b0 ta nh\u00ecn kh\u00f4ng? V\u00e0 t\u1eadp trung v\u00e0o ph\u1ea7n n\u00e0o c\u1ee7a c\u00f4 g\u00e1i? C\u00f3 gi\u1ed1ng ch\u00fang ta khi nh\u00ecn v\u00e0o c\u00e1c c\u00f4 g\u00e1i th\u00ec hay t\u1eadp trung v\u00e0o &#8220;v..&#8221; &#8230;&#8230;&#8230;&#8230;&#8230;\u00fd m\u00ecnh l\u00e0 v\u1ebb \u0111\u1eb9p kh\u00f4ng =))<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ph\u1ea7n 1 &#8211; Nh\u1eafc l\u1ea1i ch\u00fat v\u1ec1 m\u1ea1ng CNN v\u00e0 c\u00e1ch CNN nh\u00ecn \u0111\u1eddi<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\" alt=\"\"\/><figcaption>Ngu\u1ed3n: <a href=\"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ea1i \u0111\u00e2y<\/a><\/figcaption><\/figure>\n\n\n\n<p>Nh\u01b0 c\u00e1c b\u00e0i tr\u01b0\u1edbc m\u00ecnh \u0111\u00e3 vi\u1ebft tr\u00ean M\u00ec AI Blog c\u0169ng nh\u01b0 k\u00eanh youtube M\u00ec AI, CNN s\u1eed d\u1ee5ng c\u00e1c kh\u00e1i ni\u1ec7m c\u00e1c filter v\u1edbi c\u00e1c kernel size kh\u00e1c nhau \u0111\u1ec3 qu\u00e9t qua t\u1ea5m \u1ea3nh t\u1eeb tr\u00ean xu\u1ed1ng d\u01b0\u1edbi, t\u1eeb tr\u00e1i sang ph\u1ea3i (l\u00fd thuy\u1ebft th\u00f4i nh\u00e9, th\u1ef1c t\u1ebf train qua GPU n\u00f3 ch\u01a1i \u0111\u1ed3ng th\u1eddi lu\u00f4n \u00e1). Sau khi qu\u00e9t xong, n\u00f3 s\u1ebd t\u1ea1o ra (b\u1eb1ng c\u00e1ch nh\u00e2n l\u1ea7n l\u01b0\u1ee3t ma tr\u1eadn filter v\u00e0 m\u1ed9t ph\u1ea7n c\u1ee7a t\u1ea5m \u1ea3nh) c\u00e1c feature maps &#8211; c\u00e1c \u0111\u1eb7c tr\u01b0ng tr\u00edch ra \u0111\u01b0\u1ee3c t\u1eeb t\u1ea5m \u1ea3nh.<\/p>\n\n\n\n<p>\u0110\u00f3, v\u00e0 features maps ch\u00ednh l\u00e0 nh\u1eefng g\u00ec m\u00e0 CNN nh\u00ecn th\u1ea5y t\u1eeb t\u1ea5m \u1ea3nh.<\/p>\n\n\n\n<p>R\u1ed3i, nh\u01b0ng ta s\u1ebd th\u1eafc m\u1eafc trong nh\u1eefng th\u1ee9 m\u00e0 CNN n\u00f3 nh\u00ecn th\u1ea5y th\u00ec n\u00f3 t\u1eadp trung v\u00e0o ph\u1ea7n n\u00e0o nh\u1ea5t \u0111\u1ec3 c\u00f3 th\u1ec3 predict ra \u0111\u00fang class c\u1ee7a t\u1ea5m \u1ea3nh. V\u00ed d\u1ee5: \u0111\u01b0a v\u00e0o m\u1ed9t t\u1ea5m \u1ea3nh, CNN predict ra l\u00e0 GIRL, v\u1eady ch\u00fang ta c\u1ea7n bi\u1ebft \u0111\u01b0\u1ee3c model \u0111\u00e3 d\u1ef1a v\u00e0o ph\u1ea7n n\u00e0o trong nh\u1eefng ph\u1ea7n n\u00f3 nh\u00ecn th\u1ea5y \u0111\u1ec3 d\u1ef1 \u0111o\u00e1n \u0111\u00e2y l\u00e0 girl.<\/p>\n\n\n\n<p>Ch\u00fang ta s\u1ebd c\u00f9ng nhau t\u00ecm hi\u1ec3u c\u00e1c v\u1ea5n \u0111\u1ec1 tr\u00ean nh\u00e9! Trong b\u00e0i n\u00e0y ta s\u1ebd c\u00f9ng m\u1ed5 x\u1ebb v\u00e0 t\u00ecm hi\u1ec3u (visualize feature maps, heatmap) v\u1edbi m\u1ed9t model c\u1ee5 th\u1ec3 l\u00e0 VGG16.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ph\u1ea7n 2 &#8211; T\u00ecm hi\u1ec3u xem CNN nh\u00ecn th\u1ea5y nh\u1eefng g\u00ec? (visualize feature maps)<\/h2>\n\n\n\n<p>Th\u1ef1c ra l\u00e0 ch\u00fang ta s\u1ebd in ra c\u00e1c Feature Maps \u1ea5y m\u00e0 kaka!<\/p>\n\n\n\n<p>R\u1ed3i, VGG16 th\u00ec m\u1ecdi ng\u01b0\u1eddi r\u00f5 ki\u1ebfn tr\u00fac c\u1ee7a n\u00f3 r\u1ed3i, c\u1ee5 th\u1ec3 nh\u01b0 sau:<\/p>\n\n\n\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-5095883280136027\" data-ad-slot=\"7735063137\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.researchgate.net\/profile\/Saikat_Roy9\/publication\/322787849\/figure\/fig1\/AS:588338117488642@1517282146532\/VGG16-Architecture-with-Softmax-layer-replaced-used-as-the-base-model-for-each-classifier.png\" alt=\"\"\/><figcaption>Ngu\u1ed3n: <a href=\"https:\/\/www.researchgate.net\/profile\/Saikat_Roy9\/publication\/322787849\/figure\/fig1\/AS:588338117488642@1517282146532\/VGG16-Architecture-with-Softmax-layer-replaced-used-as-the-base-model-for-each-classifier.png\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ea1i \u0111\u00e2y<\/a><\/figcaption><\/figure>\n\n\n\n<p>V\u1edbi model n\u00e0y,  khi ta \u0111\u01b0a \u1ea3nh 224x224x3 v\u00e0o , n\u00f3 s\u1ebd tr\u1ea3 ra 1 vector softmax \u0111\u1ec3 t\u1eeb \u0111\u00f3 ta in ra class c\u1ee7a t\u1ea5m \u1ea3nh.<\/p>\n\n\n\n<p>Ngo\u00e0i ra, nh\u00ecn v\u00e0o \u0111\u00f3 c\u00e1c b\u1ea1n s\u1ebd th\u00e1y c\u00f3 t\u1ea5t c\u1ea3 5 convolution block v\u00e0 trong \u0111\u00f3 c\u00f3 13 convolution layers (m\u00e0u xanh blue). K\u00edch th\u01b0\u1edbc output c\u1ee7a c\u00e1c conv block nh\u01b0 sau:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/qph.fs.quoracdn.net\/main-qimg-e657c195fc2696c7d5fc0b1e3682fde6\" alt=\"\"\/><figcaption>Ngu\u1ed3n: <a href=\"https:\/\/qph.fs.quoracdn.net\/main-qimg-e657c195fc2696c7d5fc0b1e3682fde6\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ea1i \u0111\u00e2y<\/a><\/figcaption><\/figure>\n\n\n\n<p>V\u00e0 b\u00e2y gi\u1edd mu\u1ed1n bi\u1ebft CNN nh\u00ecn th\u1ea5y g\u00ec, ta s\u1ebd in ra output sau c\u00e1c layer Conv l\u00e0 okie (ch\u00ednh l\u00e0 c\u00e1c Feature map). \u0110\u1ec3 l\u00e0m \u0111\u01b0\u1ee3c \u0111i\u1ec1u n\u00e0y ta ph\u1ea3i ti\u1ebfn h\u00e0nh load weights VGG16 pretrain tr\u00ean Imagenet sau \u0111\u00f3 t\u1ea1o ra m\u1ed9t model m\u1edbi v\u1eabn d\u00f9ng chung weights \u0111\u00f3 nh\u01b0ng ki\u1ebfn tr\u00fac s\u1ebd l\u00e0 <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Input: \u1ea2nh \u0111\u1ea7u v\u00e0o<\/li><li>Output: L\u00e0 c\u00e1c output t\u1ea1i c\u00e1c layer ta c\u1ea7n in feature maps<\/li><\/ul>\n\n\n\n<p>V\u00ed d\u1ee5 ta s\u1ebd s\u1eeda nh\u01b0 sau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vgg_model = VGG16()\n# Ta l\u1ea5y ra 3 ouput sau layer 2, 9 v\u00e0 17\noutput_layer_list = &#91;2, 9, 17]\noutputs = &#91;vgg_model.layers&#91;idx].output for idx in output_layer_list]\nmodel = Model(inputs=vgg_model.inputs, outputs=outputs)<\/code><\/pre>\n\n\n\n<p>Sau khi ch\u1ea1y \u0111o\u1ea1n code tr\u00ean th\u00ec model s\u1ebd l\u00e0 bi\u1ebfn l\u01b0u model m\u00e0 ch\u00fang ta c\u1ea7n s\u1eed d\u1ee5ng \u0111\u1ec3 in ra c\u00e1c feature maps (ch\u00fa \u00fd \u1edf \u0111\u00e2y l\u00e0 model 1 input v\u00e0 nhi\u1ec1u output nh\u00e9).<\/p>\n\n\n\n<p>R\u1ed3i, b\u00e2y gi\u1edd m\u00ecnh s\u1ebd load 1 t\u1ea5m \u1ea3nh con b\u00f2 v\u00e0 \u0111\u01b0a v\u00e0o trong m\u1ea1ng \u0111\u1ec3 xem model nh\u00ecn con b\u00f2 n\u00e0y nh\u01b0 n\u00e0o n\u00e0o:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.treehugger.com\/thmb\/D34D4234OfW1nfOgr1BQAC2rFgg=\/1000x667\/filters:no_upscale():max_bytes(150000):strip_icc()\/__opt__aboutcom__coeus__resources__content_migration__mnn__images__2017__01__cow-in-pasture-990e51c0b8da4e839195b85ca92aed9f.jpg\" alt=\"\"\/><figcaption>Ngu\u1ed3n: <a href=\"https:\/\/www.treehugger.com\/thmb\/D34D4234OfW1nfOgr1BQAC2rFgg=\/1000x667\/filters:no_upscale():max_bytes(150000):strip_icc()\/__opt__aboutcom__coeus__resources__content_migration__mnn__images__2017__01__cow-in-pasture-990e51c0b8da4e839195b85ca92aed9f.jpg\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ea1i \u0111\u00e2y<\/a><\/figcaption><\/figure>\n\n\n\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-5095883280136027\" data-ad-slot=\"7735063137\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>T\u1ea5t c\u1ea3 \u0111\u1ec1u d\u00f9ng l\u1ec7nh c\u1ee7a Keras nh\u00e9:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from keras.applications.vgg16 import preprocess_input\nfrom keras.preprocessing.image import load_img\nfrom keras.preprocessing.image import img_to_array\n\n# Load \u1ea3nh\nnet_input_size = (224,244)\nframe = load_img('cow.jpg', target_size=net_input_size)\nframe = img_to_array(frame)\nframe = expand_dims(frame, axis=0)\nframe = preprocess_input(frame)\n\n# \u0110\u01b0a v\u00e0o model (m\u1edbi t\u1ea1o \u1ea5y nh\u00e9) \u0111\u1ec3 l\u1ea5y output\nfeature_maps = model.predict(frame)<\/code><\/pre>\n\n\n\n<p>Sau b\u01b0\u1edbc n\u00e0y, ta s\u1ebd c\u00f3 \u0111\u01b0\u1ee3c 3 output sau 3 conv layer, m\u1ed7i output s\u1ebd c\u00f3 size kh\u00e1c nhau nh\u01b0ng \u0111\u1ec1u c\u00f3 64 filter trong m\u1ed7i ouput. Do \u0111\u00f3, v\u1edbi m\u1ed7i output ta s\u1ebd v\u1ebd ra 64 filter n\u00e0y theo grid 8&#215;8 (cho \u0111\u1eb9p th\u00f4i, v\u1ebd c\u00e1ch n\u00e0o c\u0169ng \u0111\u01b0\u1ee3c nh\u00e9).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\nitem_per_col = int(math.sqrt(feature_maps&#91;0].shape&#91;3])) # C\u0103n b\u1eadc 2 c\u1ee7a 64 l\u00e0 8\nfor fm in feature_maps:\n\tidx = 1\n\tfor _ in range(item_per_col):\n\t\tfor _ in range(item_per_col):\n\t\t\tax = pyplot.subplot(item_per_col, item_per_col, idx)\n\t\t\tax.set_xticks(&#91;])\n\t\t\tax.set_yticks(&#91;])\n\t\t\tpyplot.imshow(fm&#91;0, :, :, idx-1])\n\t\t\tidx += 1\n\tpyplot.show()<\/code><\/pre>\n\n\n\n<p> V\u00e0 k\u1ebft qu\u1ea3 s\u1ebd c\u00f3 3 \u1ea3nh l\u00e0 3 output, \u0111\u00f3 ch\u00ednh l\u00e0 nh\u1eefng g\u00ec CNN nh\u00ecn th\u1ea5y \u0111\u00f3. C\u00e1c b\u1ea1n c\u00f3 th\u1ea5y c\u00e1c layer v\u1ec1 sau s\u1ebd nh\u00ecn b\u1ee9c \u1ea3nh m\u1ed9t c\u00e1ch t\u1ed5ng qu\u00e1t, c\u00f2n c\u00e1c layer \u0111\u1ea7u s\u1ebd nh\u00ecn chi ti\u1ebft b\u1ee9c \u1ea3nh kh\u00f4ng?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/thangnch\/photo2\/blob\/main\/vgg_fm_01.png?raw=true\" alt=\"visualize feature maps\"\/><figcaption>Output c\u1ee7a Conv layer s\u1ed1 2<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/thangnch\/photo2\/blob\/main\/vgg_fm_02.png?raw=true\" alt=\"\"\/><figcaption>Output c\u1ee7a Conv layer s\u1ed1 9<\/figcaption><\/figure>\n\n\n\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-5095883280136027\" data-ad-slot=\"7735063137\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/thangnch\/photo2\/blob\/main\/vgg_fm_03.png?raw=true\" alt=\"visualize feature maps \"\/><figcaption>Output c\u1ee7a Conv layer s\u1ed1 17<\/figcaption><\/figure>\n\n\n\n<p>\u0110\u1ea5y. model nh\u00ecn th\u1ea5y th\u1ebf \u0111\u1ea5y, v\u00e0 sau \u0111\u00f3 n\u00f3 s\u1ebd d\u1ef1a v\u00e0o c\u00e1c input n\u00f3 nh\u00ecn th\u1ea5y \u0111\u1ec3 predict ra \u0111\u00fang class c\u1ee7a b\u1ee9c \u1ea3nh. N\u00f3 kh\u00f4ng nh\u00ecn th\u1ea5y nh\u01b0 ch\u00fang ta v\u00e0 x\u1eed l\u00fd nh\u01b0 ch\u00fang ta nh\u1ec9 \ud83d\ude00<\/p>\n\n\n\n<p>Ti\u1ebfp theo ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u xem v\u1eady v\u1edbi m\u1ed9t b\u1ee9c \u1ea3nh con b\u00f2 nh\u01b0 n\u00e0y th\u00ec model s\u1ebd t\u1eadp trung v\u00e0o ph\u1ea7n n\u00e0o nh\u1ea5t \u0111\u1ec3 c\u00f3 th\u1ec3 d\u1ef1 \u0111o\u00e1n \u0111\u00fang l\u00e0 con b\u00f2 ch\u1ee9 ko ra con ch\u00f3 nh\u00e9!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ph\u1ea7n 3 &#8211; CNN ch\u00fa \u00fd v\u00e0o ph\u1ea7n n\u00e0o c\u1ee7a b\u1ee9c \u1ea3nh con b\u00f2? (visualize feature heatmap)<\/h2>\n\n\n\n<p>\u0110\u1ea7u ti\u00ean ta c\u0169ng kh\u1edfi t\u1ea1o VGG16 v\u00e0 load \u1ea3nh nh\u01b0 tr\u00ean:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>model = VGG16()\nmodel.summary()\n#\n load \u1ea3nh\nnet_input_size = (224,224)\nframe = load_img('cow.jpg', target_size=net_input_size)\nframe = img_to_array(frame)\nframe = expand_dims(frame, axis=0)\nframe = preprocess_input(frame)<\/code><\/pre>\n\n\n\n<p>C\u00e1c b\u1ea1n ch\u00fa \u00fd \u1edf \u0111\u00e2y m\u00ecnh c\u00f3 s\u1eed d\u1ee5ng model.summary() m\u1ee5c \u0111\u00edch l\u00e0 l\u1ea5y ra t\u00ean conv layer cu\u1ed1i c\u00f9ng, c\u1ee5 th\u1ec3 l\u00e0 &#8216;block5_conv3&#8217;.<\/p>\n\n\n\n<p>Sau \u0111\u00f3 ch\u00fang ta s\u1eed d\u1ee5ng <strong><a href=\"https:\/\/www.tensorflow.org\/api_docs\/python\/tf\/GradientTape\" target=\"_blank\" rel=\"noreferrer noopener\">GradientTape c\u1ee7a tensorflow<\/a><\/strong>. D\u1ecbch th\u00f4 l\u00e0 b\u0103ng ghi l\u1ea1i gradient. M\u00f3n n\u00e0y s\u1ebd gi\u00fap ta l\u01b0u l\u1ea1i \u0111\u01b0\u1ee3c gradient \u0111\u1ec3 t\u00ednh heatmap:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>with tf.GradientTape() as tape:\n\t# T\u1ea1o ra m\u1ed9t model m\u1edbi c\u00f3 1 input v\u00e0 2 output l\u00e0 output c\u1ee7a model v\u00e0 output c\u1ee7a conv layer cu\u1ed1i c\u00f9ng\n\tlast_conv_layer = model.get_layer('block5_conv3')\n\tnew_model = tf.keras.models.Model(&#91;model.inputs], &#91;model.output, last_conv_layer.output])\n\n\t# \u0110\u01b0a \u1ea3nh v\u00e0o model m\u1edbi \u0111\u1ec3 l\u1ea5y output\n\tmodel_out, last_conv_layer = new_model(frame)\n\n\t# L\u1ea5y output c\u00f3 prob l\u1edbn nh\u1ea5t\n\tclass_out = model_out&#91;:, np.argmax(model_out&#91;0])]\n\n\t# T\u00ednh gradient c\u1ee7a class output \u0111\u1ed1i v\u1edbi output c\u1ee7a last_conv_layer\n\tgrads = tape.gradient(class_out, last_conv_layer)\n\n\n\t# T\u00ednh gi\u00e1 tr\u1ecb trung b\u00ecnh c\u1ee7a gradient, k\u1ebft qu\u1ea3 l\u00e0 1 vector 512\n\tpooled_grads = K.mean(grads, axis=(0, 1, 2))<\/code><\/pre>\n\n\n\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-5095883280136027\" data-ad-slot=\"7735063137\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p> Ti\u1ebfp \u0111\u00f3 l\u00e0 t\u00ednh heatmap v\u00e0 x\u1eed l\u00fd qua 1 ch\u00fat (\u0111\u1ec3 v\u1ebd ColorMap cho ti\u1ec7n)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n# Nh\u00e2n pooled_grads v\u1edbi output c\u1ee7a last_conv_layer v\u00e0 l\u1ea5y mean \u0111\u1ec3 c\u00f3 heatmap.\n# Ch\u00fa \u00fd last_conv_layer c\u00f3 size (1, 14,14,512)\n# Output l\u00e0 heatmap size (1,14,14)\nheatmap = tf.reduce_mean(tf.multiply(pooled_grads, last_conv_layer), axis=-1)\n\n# X\u1eed l\u00fd heat map, b\u1ecf gi\u00e1 tr\u1ecb \u00e2m, scale l\u1ea1i gi\u00e1 tr\u1ecb v\u1ec1 0,1\nheatmap = np.maximum(heatmap, 0)\nheatmap \/= np.max(heatmap)\nheatmap = heatmap.reshape((14, 14))<\/code><\/pre>\n\n\n\n<p>V\u00e0 cu\u1ed1i c\u00f9ng l\u00e0 ta load \u1ea3nh v\u00e0 show h\u00e0ng th\u00f4i:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n# V\u1ebd heatmap l\u00ean \u1ea3nh\n# \u0110\u1ecdc \u1ea3nh con b\u00f2\nimg = cv2.imread('cow.jpg')\n\n# Ch\u1ec9nh l\u1ea1i heatmap\nheatmap = cv2.resize(heatmap, (img.shape&#91;1], img.shape&#91;0]))\nheatmap = cv2.applyColorMap(np.uint8(255 * heatmap), cv2.COLORMAP_JET)\n\n# V\u1ebd heatmap l\u00ean \u1ea3nh\noverlay_img = cv2.addWeighted(img, 0.6, heatmap, 0.4, 0)\ncv2.imshow(\"B\",overlay_img)\ncv2.waitKey()<\/code><\/pre>\n\n\n\n<p>V\u00e0 \u0111\u00e2y, model c\u1ee7a ch\u00fang ta t\u1eadp trung v\u00e0o ph\u1ea7n \u0111\u1ea7u con b\u00f2 \u0111\u1ec3 predict, kh\u00f4n ra ph\u1ebft:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/thangnch\/photo2\/blob\/main\/cow_heatmap_1.png?raw=true\" alt=\"visualize feature maps heatmap\"\/><\/figure>\n\n\n\n<p>B\u00e2y gi\u1edd \u0111\u1ec3 th\u00eam ph\u1ea7n funny, m\u00ecnh th\u1eed 1 c\u00e1i \u1ea3nh kh\u00e1c xem sao \ud83d\ude00<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/github.com\/thangnch\/photo2\/blob\/main\/girl_heatmap.png?raw=true\" alt=\"visualize heatmap\"\/><\/figure><\/div>\n\n\n\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-5095883280136027\" data-ad-slot=\"7735063137\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>B\u1ed1 \u00f4ng model CNN t\u1eadp trung to\u00e0n \u0111i\u1ec3m &#8220;kh\u00f4n&#8221; th\u1ebf kh\u00f4ng bi\u1ebft =)). Kh\u00f4n nh\u01b0 \u00f4ng qu\u00ea t\u00f4i \u0111\u1ea7y \ud83d\ude00<\/p>\n\n\n\n<p>Ok, v\u1eady l\u00e0 m\u00ecnh \u0111\u00e3 guide c\u00e1c b\u1ea1n visualize feature maps, heatmap v\u00e0 t\u00ecm hi\u1ec3u xem model CNN nh\u00ecn \u0111\u1eddi qua l\u0103ng k\u00ednh Convolution ra sao r\u1ed3i. Hi v\u1ecdng c\u00e1c b\u1ea1n \u0111\u00e3 hi\u1ec3u v\u1ea5n \u0111\u1ec1. N\u1ebfu c\u00f2n th\u1eafc m\u1eafc g\u00ec c\u00e1c b\u1ea1n c\u1ee9 post l\u00ean <strong><a href=\"https:\/\/www.facebook.com\/groups\/miaigroup\">https:\/\/www.facebook.com\/groups\/miaigroup<\/a><\/strong> \u0111\u1ec3 c\u00f9ng trao \u0111\u1ed5i nh\u00e9.<\/p>\n\n\n\n<p>H\u1eb9n g\u1eb7p l\u1ea1i c\u00e1c b\u1ea1n! M\u00ecnh xin t\u1eb7ng b\u1ea1n n\u00e0o \u0111\u1ecdc \u0111\u1ebfn \u0111\u00e2y link github thay l\u1eddi c\u1ea3m \u01a1n nha:&nbsp;<strong><a href=\"https:\/\/github.com\/thangnch\/MIAI_CNN_Heatmap_Visualize\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ea1i \u0111\u00e2y<\/a><\/strong>.<\/p>\n\n\n\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n\n\n\n<p>#M\u00ecAI<\/p>\n\n\n\n<p>Fanpage:&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/facebook.com\/miaiblog\" target=\"_blank\"><strong>http:\/\/facebook.com\/miaiblog<\/strong><\/a><br>Group trao \u0111\u1ed5i, chia s\u1ebb:&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.facebook.com\/groups\/miaigroup\" target=\"_blank\"><strong>https:\/\/www.facebook.com\/groups\/miaigroup<\/strong><\/a><br>Website:&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/miai.vn\/\" target=\"_blank\"><strong>https:\/\/miai.vn\/<\/strong><\/a><br>Youtube:&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/bit.ly\/miaiyoutube\" target=\"_blank\"><strong>http:\/\/bit.ly\/miaiyoutube<\/strong><\/a><\/p>\n\n\n\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-5095883280136027\" data-ad-slot=\"7735063137\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>T\u00e0i li\u1ec7u tham kh\u1ea3o:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>https:\/\/github.com\/Anil-matcha\/EIP3-Assignments\/blob\/master\/Gradcam.ipynb<\/li><li>https:\/\/machinelearningmastery.com\/how-to-visualize-filters-and-feature-maps-in-convolutional-neural-networks\/<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hello anh em, ch\u00fang ta \u0111\u00e3 l\u00e0m vi\u1ec7c v\u1edbi m\u1ea1ng CNN \u0111\u00e3 l\u00e2u l\u1eafm r\u1ed3i, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap). Ch\u00fang ta s\u1ebd c\u00f9ng t\u00ecm hi\u1ec3u xem khi ta \u0111\u01b0a m\u1ed9t v\u00e0o m\u1ea1ng m\u1ed9t h\u00ecnh \u1ea3nh [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[40,21,452,453,454,455],"class_list":["post-1334","post","type-post","status-publish","format-standard","hentry","category-computer-vision","tag-cnn","tag-deep-learning","tag-feature-map","tag-heatmap","tag-neural-network","tag-visualize"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap) - M\u00ec AI<\/title>\n<meta name=\"description\" content=\"Ch\u00e0o anh em, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/miai.vn\/?p=1334\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap) - M\u00ec AI\" \/>\n<meta property=\"og:description\" content=\"Ch\u00e0o anh em, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/miai.vn\/?p=1334\" \/>\n<meta property=\"og:site_name\" content=\"M\u00ec AI\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-06T01:23:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\" \/>\n<meta name=\"author\" content=\"Ch\u1ee7 ti\u1ec7m M\u00ec\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ch\u1ee7 ti\u1ec7m M\u00ec\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334\"},\"author\":{\"name\":\"Ch\u1ee7 ti\u1ec7m M\u00ec\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/person\\\/cc8bc24bb90bd3f596add82f3a59948c\"},\"headline\":\"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap)\",\"datePublished\":\"2021-01-06T01:23:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334\"},\"wordCount\":1470,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/developersbreach.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\",\"keywords\":[\"CNN\",\"deep learning\",\"feature map\",\"heatmap\",\"neural network\",\"visualize\"],\"articleSection\":[\"Computer Vision\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/miai.vn\\\/?p=1334#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334\",\"url\":\"https:\\\/\\\/miai.vn\\\/?p=1334\",\"name\":\"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap) - M\u00ec AI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/developersbreach.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\",\"datePublished\":\"2021-01-06T01:23:13+00:00\",\"description\":\"Ch\u00e0o anh em, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/miai.vn\\\/?p=1334\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/developersbreach.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/developersbreach.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/cnn_banner.png?fit=1400%2C658&amp;ssl=1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/miai.vn\\\/?p=1334#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/miai.vn\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#website\",\"url\":\"https:\\\/\\\/miai.vn\\\/\",\"name\":\"M\u00ec AI\",\"description\":\"H\u1ecdc AI theo c\u00e1ch M\u00ec \u0103n li\u1ec1n!\",\"publisher\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/miai.vn\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#organization\",\"name\":\"M\u00ec AI\",\"url\":\"https:\\\/\\\/miai.vn\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/miai.vn\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/cropped-Logo_w_slogan.png\",\"contentUrl\":\"https:\\\/\\\/miai.vn\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/cropped-Logo_w_slogan.png\",\"width\":240,\"height\":193,\"caption\":\"M\u00ec AI\"},\"image\":{\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/miai.vn\\\/#\\\/schema\\\/person\\\/cc8bc24bb90bd3f596add82f3a59948c\",\"name\":\"Ch\u1ee7 ti\u1ec7m M\u00ec\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g\",\"caption\":\"Ch\u1ee7 ti\u1ec7m M\u00ec\"},\"sameAs\":[\"https:\\\/\\\/miai.vn\"],\"url\":\"https:\\\/\\\/miai.vn\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap) - M\u00ec AI","description":"Ch\u00e0o anh em, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/miai.vn\/?p=1334","og_locale":"en_US","og_type":"article","og_title":"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap) - M\u00ec AI","og_description":"Ch\u00e0o anh em, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).","og_url":"https:\/\/miai.vn\/?p=1334","og_site_name":"M\u00ec AI","article_published_time":"2021-01-06T01:23:13+00:00","og_image":[{"url":"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1","type":"","width":"","height":""}],"author":"Ch\u1ee7 ti\u1ec7m M\u00ec","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ch\u1ee7 ti\u1ec7m M\u00ec","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/miai.vn\/?p=1334#article","isPartOf":{"@id":"https:\/\/miai.vn\/?p=1334"},"author":{"name":"Ch\u1ee7 ti\u1ec7m M\u00ec","@id":"https:\/\/miai.vn\/#\/schema\/person\/cc8bc24bb90bd3f596add82f3a59948c"},"headline":"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap)","datePublished":"2021-01-06T01:23:13+00:00","mainEntityOfPage":{"@id":"https:\/\/miai.vn\/?p=1334"},"wordCount":1470,"commentCount":2,"publisher":{"@id":"https:\/\/miai.vn\/#organization"},"image":{"@id":"https:\/\/miai.vn\/?p=1334#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1","keywords":["CNN","deep learning","feature map","heatmap","neural network","visualize"],"articleSection":["Computer Vision"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/miai.vn\/?p=1334#respond"]}]},{"@type":"WebPage","@id":"https:\/\/miai.vn\/?p=1334","url":"https:\/\/miai.vn\/?p=1334","name":"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap) - M\u00ec AI","isPartOf":{"@id":"https:\/\/miai.vn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/miai.vn\/?p=1334#primaryimage"},"image":{"@id":"https:\/\/miai.vn\/?p=1334#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1","datePublished":"2021-01-06T01:23:13+00:00","description":"Ch\u00e0o anh em, h\u00f4m nay ch\u00fang ta s\u1ebd \u0111i \u0111\u1ebfn m\u1ed9t m\u00f3n m\u1edbi h\u01a1n l\u00e0 nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN nh\u00e9 (visualize feature maps, heatmap).","breadcrumb":{"@id":"https:\/\/miai.vn\/?p=1334#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/miai.vn\/?p=1334"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/miai.vn\/?p=1334#primaryimage","url":"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1","contentUrl":"https:\/\/i0.wp.com\/developersbreach.com\/wp-content\/uploads\/2020\/08\/cnn_banner.png?fit=1400%2C658&amp;ssl=1"},{"@type":"BreadcrumbList","@id":"https:\/\/miai.vn\/?p=1334#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/miai.vn\/"},{"@type":"ListItem","position":2,"name":"Nh\u00ecn \u0111\u1eddi theo c\u00e1ch c\u1ee7a m\u1ea1ng CNN (visualize feature maps- heatmap)"}]},{"@type":"WebSite","@id":"https:\/\/miai.vn\/#website","url":"https:\/\/miai.vn\/","name":"M\u00ec AI","description":"H\u1ecdc AI theo c\u00e1ch M\u00ec \u0103n li\u1ec1n!","publisher":{"@id":"https:\/\/miai.vn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/miai.vn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/miai.vn\/#organization","name":"M\u00ec AI","url":"https:\/\/miai.vn\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/miai.vn\/#\/schema\/logo\/image\/","url":"https:\/\/miai.vn\/wp-content\/uploads\/2026\/05\/cropped-Logo_w_slogan.png","contentUrl":"https:\/\/miai.vn\/wp-content\/uploads\/2026\/05\/cropped-Logo_w_slogan.png","width":240,"height":193,"caption":"M\u00ec AI"},"image":{"@id":"https:\/\/miai.vn\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/miai.vn\/#\/schema\/person\/cc8bc24bb90bd3f596add82f3a59948c","name":"Ch\u1ee7 ti\u1ec7m M\u00ec","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0b5124b0d2c0a8054d7127d2c236bdc3dc7a50e2d4e8728ab32eee5b122a8d1?s=96&d=mm&r=g","caption":"Ch\u1ee7 ti\u1ec7m M\u00ec"},"sameAs":["https:\/\/miai.vn"],"url":"https:\/\/miai.vn\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/posts\/1334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1334"}],"version-history":[{"count":0,"href":"https:\/\/miai.vn\/index.php?rest_route=\/wp\/v2\/posts\/1334\/revisions"}],"wp:attachment":[{"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miai.vn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}