File Exchange

image thumbnail

Continuous activation map generation at training process

version 1.0.3 (10 MB) by Kenta
Please click the thumbnail to watch the GIF file. 概要はサムネイルをクリックして下さい.This demo shows how to continuously create a class activation mapping.

5 Downloads

Updated 22 Mar 2020

From GitHub

View Version History

View license on GitHub

[English]
This demo shows how to continuously create a class activation mapping (CAM) during the training process with a custom learning rate schedule.
Automatic differentiation enables you to customize CNN as you want. This example trains a network to classify data and simulteniously compute the CAM (Class Activation Mapping) of the validation data with the weights during the training.
This demo can visualize how the CNNs get to focus on the region in the image to classify which leads to the reability of the network and helps a lot in education of CNNs. Further, if the CNN is over-tuned to the dataset, the process also can be visualized.
The class activation mapping was done referring to the paper below.
Zhou, Bolei, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. "Learning deep features for discriminative localization." In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921-2929. 2016.
This demo using the custom training loop was made with the official document below.
https://jp.mathworks.com/help/deeplearning/ug/train-network-using-custom-training-loop.html
If you like to explore the reason of the classification behind the network for the test image, you can use this demo (https://jp.mathworks.com/matlabcentral/fileexchange/75418-classify-crack-image-using-deep-learning-and-explain-why).

[Japanese]
深層学習の分類時にどこに注目したのかを示すデモです。カスタムループを用いて、訓練中に、ネットワークの注目範囲がどのように変化するのかを可視化します。サムネイルのGIFのように、各イテレーションごとにCAMとよばれる、CNNの注目範囲を可視化し、
重み更新によって、どんどんよい特徴を捉えるようになっていることを示しています。イテレーションごとに特徴量を可視化することで、訓練の進むイメージを視覚的につかめるかもしれないと思い作成しました。カスタムループを用いない例は以下のURLにありました。
https://jp.mathworks.com/matlabcentral/fileexchange/69357-class-activation-mapping
また、可視化のほかの例としては以下のようなものがあります。
https://jp.mathworks.com/matlabcentral/fileexchange/75418-classify-crack-image-using-deep-learning-and-explain-why

Cite As

Kenta (2021). Continuous activation map generation at training process (https://github.com/giants19/Continuous-class-activation-generation-during-training-process-using-Matlab), GitHub. Retrieved .

Comments and Ratings (5)

Rine_C

Yoshito Saito

Takuji Fukumoto

Shunichi Kusano

Interesting! I see how computer "eyes" develop.

michio

Intriguing visualization of the training process!

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!