Towards AI Can Help your Team Adopt AI: Corporate Training, Consulting, and Talent Solutions.


Crack Detection in Concrete
Latest   Machine Learning

Crack Detection in Concrete

Last Updated on July 19, 2023 by Editorial Team

Author(s): Chittal Patel

Originally published on Towards AI.

Photo by Maud CORREA on Unsplash

Computer Vision

Using Computer Vision


Crack detection is crucial in monitoring the health of infrastructural buildings. As seasons change and the level of moisture remains inconsistent across the year and also due to bad quality of the materials used for construction, cracks usually start to develop in walls of buildings and roads as well. So, before reaching more degraded condition, The foremost signs is of development of cracks on the concrete surface. Beams, Walls, and Roads of concrete are usually stressed which leads to crack which can be formally observed at the microscopic level on the surface. After there minor cracks, Slowly and slowly cracks get broaden due to load and increases its length as well as width. We can conclude that before more damage is induced we can detect the cracks early so that preventive measures can be taken on a serious note leading to fast recovery of the health of the structure.

The determination of factors that are important is the type, number, width and length of the cracks found on the structural surface. This helps determine the degradation level, structural health, and carrying capacity of the concrete structures.

Crack detection can be done by manual human inspection whereby, Testing officials will observe each crack manually measure its dimensions which will help further in calculations of how impactful it will be on the degradation of structural health. The disadvantages of manual human inspection are 1) It takes a lot of time. 2) The human inspection often misses minute cracks that can further broaden. 3) Often misses many cracks that are needed to be monitored. This creates a need for fast, powerful, automatic, and reliable crack detection and analysis strategy. So, Automatic crack detection systems are developed to overcome the slow and traditional human inspection methods.

Basically crack is a visible entity and so image-based crack detection algorithms can be adapted for inspection. Also, some sort of difficulties in the image-based detection procedures are also faced due to the random shape, irregular sizes of crack, and noises in images viz. irregular illuminated conditions, shading, and blemishes. Deep learning algorithms can be applied to solving many challenging problems in image classification. Therefore, Now we conquer this problem of detecting the cracks using image processing methods, deep learning algorithms, and Computer Vision.

Problem is addressed by a simple approach of using image classification with Transfer Learning to classify the images in two categories: Negative (Doesn’t contain Crack) and Positive (Contains Crack).


Data-set is concrete crack images for classification and the source is and the citation will be provided at the bottom and of course, I’d like to thank the authors for their contribution. We will have two classes of images where the cracked concrete surface will be categorized as positive and the images with no cracks on the surface will be categorized as negative. Let’s review the data set: There are 40,000 RGB images wherein 20,000 are positive and the rest 20,000 are negative. 75% of the images will be used for training and 25% of the images will be used for testing where around ~23% would be for validation and rest ~2% would be for Testing.

Visualizing Data

Code to visualize the data :

Images that Contain Crack (Positive)

Images that don’t contain Crack (Negative)


Images will be trained on the VGG16 Model. So, First images will be converted to (244,244,3) viz. The default size of the VGG16 Model.

Due to memory issues, Images will be directly read from the directory using the flow from the directory.

The Architecture of Model contains A VGG16 model connected to a Linear layer with 10 neurons further connected to the Linear layer with 2 output nodes with softmax activation.

The model will be trained for 10 epochs and a batch size of 100.

Further training and validation Loss and Accuracy are the plot.


Testing is done on 500 images that are directly fetched from the directory.

The loss and accuracy are calculated and prediction probabilities are also calculated for the test set.


The score for 10 epochs


Loss: 0.0040 — — — — — Accuracy: 0.9991


Loss: 0.0146 — — — — — Accuracy: 0.9969


Loss: 0.0017 — — — — — Accuracy: 1.0000

Here is the whole notebook code…

Also, you can find the repository on Github.


  1. A. M. A. Talab, Z. Huang, F. Xi, and L. HaiMing, “Detection crack in image using Otsu method and multiple filtering in image processing techniques,” Optik-International Journal for Light and Electron Optics, vol. 127, no. 3, pp. 1030–1033, 2016. View at: Publisher Site U+007C Google Scholar
  2. R. S. Adhikari, O. Moselhi, and A. Bagchi, “Image-based retrieval of concrete crack properties for bridge inspection,” Automation in Construction, vol. 39, pp. 180–194, 2014. View at: Publisher Site U+007C Google Scholar
  3. M. M. Torok, M. Golparvar-Fard, and K. B. Kochersberger, “Image-based automated 3D crack detection for post-disaster building assessment,” Journal of Computing in Civil Engineering, vol. 28, no. 5, p. A4014004, 2014. View at: Publisher Site U+007C Google Scholar
  4. D. Thatoi, P. Guru, P. K. Jena, S. Choudhury, and H. C. Das, “Comparison of CFBP, FFBP, and RBF networks in the field of crack detection,” Modelling and Simulation in Engineering, vol. 2014, Article ID 292175, 13 pages, 2014. View at: Publisher Site U+007C Google Scholar
  5. C. Koch, K. Georgieva, V. Kasireddy, B. Akinci, and P. Fieguth, “A review on computer vision-based defect detection and condition assessment of concrete and asphalt civil infrastructure,” Advanced Engineering Informatics, vol. 29, no. 2, pp. 196–210, 2015. View at: Publisher Site U+007C Google Scholar
  6. B. Y. Lee, Y. Y. Kim, S.-T. Yi, and J.-K. Kim, “Automated image processing technique for detecting and analyzing concrete surface cracks,” Structure and Infrastructure Engineering, vol. 9, no. 6, pp. 567–577, 2013. View at: Publisher Site U+007C Google Scholar
  7. H. Kim, E. Ahn, S. Cho, M. Shin, and S.-H. Sim, “Comparative analysis of image binarization methods for crack identification in concrete structures,” Cement and Concrete Research, vol. 99, pp. 53–61, 2017. View at: Publisher Site U+007C Google Scholar
  8. H. Zakeri, F. M. Nejad, and A. Fahimifar, “Image-based techniques for crack detection, classification and quantification in asphalt pavement: a review,” Archives of Computational Methods in Engineering, vol. 24, no. 4, pp. 935–977, 2016. View at: Publisher Site U+007C Google Scholar
  9. A. Mohan and S. Poobal, “Crack detection using image processing: a critical review and analysis,” Alexandria Engineering Journal, 2017. View at: Publisher Site U+007C Google Scholar
  10. N. Chaki, S. H. Shaikh, and K. Saeed, “Applications of binarization,” in Exploring Image Binarization Techniques, pp. 65–70, Springer, New Delhi, India, 2014. View at: Google Scholar
  11. N. Otsu, “A threshold selection method from gray-level histograms,” IEEE Transactions on Systems, Man, and Cybernetic, vol. 9, no. 1, pp. 62–66, 1979. View at: Publisher Site U+007C Google Scholar
  12. A. Rimkus, A. Podviezko, and V. Gribniak, “Processing digital images for crack localization in reinforced concrete members,” Procedia Engineering, vol. 122, pp. 239–243, 2015. View at: Publisher Site U+007C Google Scholar
  13. T. Yu, A. Zhu, and Y. Chen, “Efficient crack detection method for tunnel lining surface cracks based on infrared images,” Journal of Computing in Civil Engineering, vol. 31, no. 3, p. 04016067, 2017. View at: Publisher Site U+007C Google Scholar
  14. L. Ying and E. Salari, “Beamlet transform-based technique for pavement crack detection and classification,” Computer-Aided Civil and Infrastructure Engineering, vol. 25, no. 8, pp. 572–580, 2010. View at: Publisher Site U+007C Google Scholar
  15. B. Santhi, G. Krishnamurthy, S. Siddharth, and P. K. Ramakrishnan, “Automatic detection of cracks in pavements using edge detection operator,” Journal of Theoretical and Applied Information Technology, vol. 36, pp. 199–205, 2012. View at: Google Scholar
  16. A. Ayenu-Prah and N. Attoh-Okine, “Evaluating pavement cracks with bidimensional empirical mode decomposition,” EURASIP Journal on Advances in Signal Processing, vol. 2008, p. 861701, 2008. View at: Publisher Site U+007C Google Scholar
  17. Q. Zou, Y. Cao, Q. Li, Q. Mao, and S. Wang, “CrackTree: automatic crack detection from pavement images,” Pattern Recognition Letters, vol. 33, no. 3, pp. 227–238, 2012. View at: Publisher Site U+007C Google Scholar
  18. W. Niblack, An Introduction to Digital Image Processing, Strandberg Publishing Company, Birkeroed, Denmark, 1986.
  19. K. Bose and S. K. Bandyopadhyay, “Crack detection and classification in concrete structure,” Journal for Research, vol. 2, pp. 29–38, 2016. View at: Google Scholar
  20. M. Kamaliardakani, L. Sun, and M. K. Ardakani, “Sealed-crack detection algorithm using heuristic thresholding approach,” Journal of Computing in Civil Engineering, vol. 30, no. 1, p. 04014110, 2016. View at: Publisher Site U+007C Google Scholar

Thanks for viewing the article. I would love to answer any queries in the comments.

Learn ←→ Share

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI

Feedback ↓