## 4 The Convolutional Neural Network Model  
The next approach analyzed in this paper is the Convolutional Neural Network (CNN). The goal of the CNN model is to reduce the images into a form in which it is easier to process without losing the features that are critical for providing a good prediction [27]. The basic process of using a neural network starts with building a model, training the network, and finally, testing the network on a validation or on real-world data. The training process takes in some labeled training data and gives a prediction for that data. When the model prediction does not match the expected output, the internal model weights are  
Figure 3: Examples of the negative damage images for the CC approach. Figure 2: Examples of the positive damage images for the CC approach. adjusted through the process of backpropagation, which is a backwards traversal through the network, updating each layer of weights along the way, with the goal of changing values to provide a better prediction in the next iteration. When enough high-quality, representative training data are used, the network is likely to provide high-quality outputs that match what is desired. Convolutional neural networks use all of these principles of a neural network, and apply them to image frames. The process of convolution involves using kernels, which are small square matrices with specific values. These kernels are multiplied by the pixel values of every area of an image sequentially to create an output matrix called a \"feature map.\" Typically, different kernels are used to create different feature maps for each image frame. These feature maps undergo additional processing, such as padding and pooling, which aims to reduce the size of the representation while losing as little accuracy as possible for the further iterations of convolution to strengthen the feature representation. In general, the CNNs do not need to be limited to only one Convolutional Layer. Usually, the first CNN layer is responsible for capturing the Low-Level features such as the colors, gradient orientation, and edges, among others. By adding more layers, the general architecture adapts to High-Level features as well, providing a full network [28]. When the convolutional process is complete, the resulting feature maps are flattened and inputted as vectors into what is essentially a standard neural network for classification purposes, where the actual prediction is made. Furthermore, two extensions of CNN, namely region-based CNN (R-CNN) [29] and Fast R-CNN [30], are presented in the literature. In this study, the TensorFlow Object Detection API for Python is utilized for damage detection. This API features a suite of convolutional neural network models designed for object detection. All models in the TensorFlow model zoo come pretrained on the COCO 2017 dataset as a starting point, but can simply be re-trained with the appropriate data to fit any object detection task. The Faster R-CNN Inception ResNet V2 640 \(\times\) 640 p model is used and re-trained on the ISBDA dataset [31]. This model is one of the more accurate in precision in the model zoo, scoring a 37.7% mean average precision score. This accuracy comes at the cost of a fairly long processing time of 206 milliseconds per frame. If this system requires immediate analysis of a UAV's footage, it could lead to a delay, but in the scenario of a post-processing case, it is not critical. Additional Python libraries used for this study include OpenCV for video reading and writing, as well as NumPy for the image format manipulation. The developed algorithm consists of three parts: the bounding boxes, the corresponding class label, and the corresponding confidence ratings, similar to the CC approach. For this approach, the Instance Segmentation in Building Damage Assessment (ISBDA) dataset is used [31]. This dataset consists of 1030 total images, 908 of them were selected to be used in our study.