## 2 The Difficulties of Automatic Concrete-Crack Detection in the Presence of Shadow Effects  
It is important to note that real-time concrete images are often impacted by illumination conditions, randomness, irregular sizes of crack shapes and various types of noise such as shadows, shading, blemishes, concrete spall, etc. Thus, the application of the published automatic concrete-crack detection methodologies (see Table 1) on real-world images of concrete structures in the presence of the aforementioned effects often yields poor results. In this section, several of the published deep-learning methods (see Table 1) for crack detection are applied in order to demonstrate the difficulties associated with the presence of shadow effects in the concrete images.  
Firstly, the training and testing datasets are selected as follows:* **Training dataset**--the dataset published in [40], consisting of 40,000 concrete images (227 \(\times\) 227 pixels with RGB channels) with and without cracks. As mentioned above, this database has already been used by several researchers for the development of deep-learning methods for concrete-crack detection (see Table 1). Sample images of each type are displayed in the Figure 1. Note that no shadow effects are present in the images included in this dataset.
* **Testing dataset**--the dataset comprising 500 concrete images (227 \(\times\) 227 pixels with RGB channels) with and without cracks with the shadow effects present in all images. Samples images of each type are depicted in the Figure 2.  
Next, three different classification neural networks, namely, AlexNet [30], SqueezeNet [41] and VGG16 [42], are selected for further testing. These networks are chosen based on their performance in terms of speed versus prediction accuracy (see Figure 3). It can be seen from Figure 3 that AlexNet and SqueezeNet can generally be characterized by high prediction speed and lower accuracy, whereas VGG16 is usually slower in prediction but can achieve higher accuracy. In order to further benchmark the speed of those networks on the data analyzed in this paper, all three of the above are trained and tested on the training dataset, yielding the results displayed in Table 2.  
Finally, the three classification neural networks are trained on the training dataset using the transfer learning approach presented by [43] and tested on the concrete images with shadows. A sample workflow is shown in the schematic diagram in Figure 4.  
Naturally, all three classification networks trained on concrete images devoid of any information on shadow shapes yield poor prediction accuracy of approximately 50%. This is in stark contrast to the accuracy of approximately 100%, which can be achieved when both training and testing are performed on images without shadows (see Table 1). Several examples of the wrong classification of concrete images with shadows are displayed in the Figures 5 and 6. From the Grad-CAM map displayed in the Figure 6b, it can be observed  
Figure 3: The comparison of speed versus the prediction accuracy of various classification neural networks. Source—www.mathworks.com (accessed on 31 January 2021).  
Figure 2: Sample images from the testing dataset used for the concrete-crack detection. Concrete images with and without cracks are displayed in the parts (**a**,**b**), respectively.  
It is clear that training the network on datasets without shadows and testing them by using concrete crack images with shadows is not fair. One solution would be to train the network using concrete crack images with shadows; however, publicly available databases such as Mendeley Concrete Crack Images for Classification lack images with shadows and manual creation of such databases takes a lot of effort. An approach that could potentially improve the prediction accuracy for the images with shadows could be based on pre-processing the concrete images via shadow removal techniques. However, the application of such techniques is also associated with certain challenges, which are discussed in the next section.