File Exchange

image thumbnail

Classify crack image using deep learning and explain "WHY"

version 1.0.1 (3.76 MB) by Kenta
This demo shows how to classify crack images using deep learning and explain why behind the decision. このデモでは、深層学習によりひび割れ画像を分類し、さらにその特徴量の可視化を


Updated 11 May 2020

View License

This demo shows how to fine-tune a pretrained deep convolutional network called SqueezeNet [1] to perform a crack/normal image classification. The classification result was discussed using a technique to "explain why" called grad-cam. This script was made based on the official documentation [2]. For the grad-cam, I referred to [3]. About fine-tuning, please refer to the additional explanation [a] at the end of this script. In this demo, we use a dataset of concrete crack images introduced by L Zhang [4]. The data is available at [5].

この例では、深層学習を用いて、ひび割れ画像を分類するコードを示します。あらかじめ大規模な画像のデータセットで学習し、よい画像の特徴を捉えられる事前学習ネットワークを用いて、その構造をもとに学習したり、その重み初期値として利用します。また、grad-camとよばれる手法を用いて、分類の際に重要視された領域を可視化します。この例では、事前学習ネットワークの中でも非常にサイズの小さい、SqueezeNet [1] を用います。また、本デモでは、[2] [3]にある、公式ドキュメントを参考にしました。データセットは、[4]の論文で紹介されているデータセット [5]を用いました。

[Key words]
class activation mapping, classification, crack, deep learning, explainable, grad-cam,

[1] Iandola, Forrest N., Song Han, Matthew W. Moskewicz, Khalid Ashraf, William J. Dally, and Kurt Keutzer. "SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5 MB model size." arXiv preprint arXiv:1602.07360 (2016).
[2] Matlab Documentation: Train Deep Learning Network to Classify New Images
[3] Matlab Documentation: Grad-CAM Reveals the Why Behind Deep Learning Decisions
[4] Zhang, Lei, et al. "Road crack detection using deep convolutional neural network." 2016 IEEE international conference on image processing (ICIP). IEEE, 2016.
[5] Concrete Crack Images for Classification

Cite As

Kenta (2020). Classify crack image using deep learning and explain "WHY" (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Tohru Kikawada

Kazuya Machida




keywords added

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