# A Method for Detecting Pathologies in Concrete Structures Using Deep Neural Networks
## 2 Materials and Methods
### Pathology Detection  
Once the images are acquired, the first step is to determine if any pathology may be visually detected and determine the area of the image corresponding to each pathology (bounding box). For this task, we propose to use the one-stage detector YOLOv4 neural  
Figure 2: Pathologies in Concrete [17]. network architecture [22]. YOLO, an abbreviation for \"You Only Live Once\", is a neural network for real-time detection due to its enormous speed and accuracy for this problem, proposed in [23]. It has evolved through several versions, and we choose version 4, even though there are newer versions. YOLO essentially redefines object identification as a regression issue and, as it achieves a positive balance of detection accuracy and speed, has become one of the quickest object detection models. The detection pipeline for YOLO separates a picture into regions and forecasts border boxes, probabilities, and conditional class probabilities. The YOLO architecture is an end-to-end connected network for making bounding box predictions with its probabilities for classes at once, Figure 3. The model uses a single fully connected layer for predictions. YOLO uses a single interaction to propose the regions of interest, while other methods perform multiple interactions for the same image [23]. Initially, the image is split into an S \(\times\) S grid, Figure 3. The cell located in the object's center will be responsible for detecting the object. Bounding box and confidence scores will be predicted by each cell, the score defining the model's confidence that the bounding box contains the object and with what precision. YOLO uses the concept of Intersection over Union, IoU, to determine the most representative bounding box. YOLOv4 is made up of Cross Stage Partial Darknet-53 (CSPDarknet-53), Spatial Pyramid Pooling (SPP) block, and Path Aggregation Network (PANet). The CSPDarknet-53 is a cutting-edge backbone that can enhance the learning capability of CNNs. To broaden the receptive area and isolate the most important context features, the SSP block is put over CSPDarknet-53. In YOLOv4, PANet is used for parameter aggregation with various detector levels instead of the FPN used in YOLOv3 for object detection. In addition, Mosaic and Self Adversarial Training (SAT) are used to supplement the training pipeline data in YOLOv4. The detection task also involves classification after the area of possible pathology has been identified. The preparation of the detection deep learning network consists in training the database to determine the learning weights for the network. Once the training is complete, the learning can localize the trained pathologies to any other image, enabling  
Figure 3: YOLO Detection pipeline. The input image was divided into S \(\times\) S grids. Predicted bounding boxes and confidence and a class probability map for each grid cell are generated. The final detection is generated [23]. classification and the location indicated by the bounding box if it contains them. If the pathology area is already defined, classification can be direct in the case of cropped images. The nets must be trained with the appropriate dataset according to the intended use, classification, or detection. The Ozgenel [18] dataset allows for binary classification, concrete with and without cracks. The dataset CODEBRIM [17] allows the use of detection, in this case, five concrete pathologies. The algorithm uses a simple CNN to detect objects in the image. Figure 4 shows the CNN model architecture used by YOLO [23]. The network makes use of transfer learning. The initial twenty layers use this concept, starting from ImageNet pre-training, using a temporary grouping with a fully connected layer. Performance is improved due to the addition of convolution and a pre-trained network. The network ends with a fully connected layer that defines the probabilities and location of the bounding box [23]. It was necessary to adapt the annotation files from the bounding box to use YOLO.