## 3 Implementation
### Algorithm and Model Training  
To achieve more accurate discrimination between true and false damage, it is essential to replace cumbersome feature engineering with the nonlinear operations of deep neural networks. This allows for capturing richer target patterns and features, addressing classification challenges that may be difficult to discern at the surface level. However, excessively deep networks may lead to a degradation problem [33], where the accuracy of the training set plateaus or even deteriorates. Residual networks (ResNets) [34; 35] offer a solution to this issue through their unique identity mapping structure, effectively avoiding degradation. ResNet-18 [36; 37] was chosen for its more lightweight architecture, more efficient performance, faster training and inference speeds, better generalization ability, and easier training and tuning compared to other versions of ResNet. It is a high-performing model suitable for resource-constrained environments, which is suitable to tackle the problem of recognizing real damage targets. Once real damage was identified, we employed a method to estimate the number of pixel grids, enabling the quick and convenient determination of the area for each damage point. In scenarios with limited samples, the advanced U-Net++ algorithm [38; 39; 40], based on the U-shaped architecture of fully convolutional networks, was selected. It can capture features at various levels and integrate them through feature concatenation, resulting in higher accuracy in image segmentation. U-Net++ eliminates the need for manual feature extraction and efficiently utilizes limited training samples. The idea framework is shown in Figure 11.  
In this study, transfer learning and the feature pyramid network [41; 42] were employed to pinpoint the real damage of elements. The deep learning model was pretrained using a public dataset containing similar scenes, while the last several layers of the pretrained model were fine-tuned using online-offline image sample data of elements after data augmentation. The deep learning model adopted a feature pyramid network structure  
Figure 11: The algorithm framework of damage detection. Figure 10: Crop Braille marks after positioning. based on ResNet-18, which had 18 main layers, with 16 convolutional layers and 2 fully connected layers, as illustrated in Figure 12.  
The resolution of the online and converted offline images, approximately 3000 \(\times\) 3000, exceeded the neural network's input capacity. Consequently, the images were resized into smaller patches with a resolution of 32 \(\times\) 32 pixels for inputting into the network. Subsequently, the LASNR [43] algorithm was employed to identify highlight positions and determine their full extent on the offline image. These marked points on the offline image represented actual damage instances and served as input labels for training the network, as illustrated in Figure 13. We used the Adam optimizer [44] to train the network. The initial learning rate was \(10^{-3}\), which allowed the network to converge quickly. The network was iteratively trained with a mini-batch of size 50 until the loss of verified samples was not reduced. For each iteration, we took randomly enhanced samples as input to the network. We then changed the learning rate to \(10^{-4}\) and iterated the above process to fine-tune the model, until the network converged. Following the filtration of images with a pure dark background, the dataset comprised 1650 paired images utilized for training the network, each with a resolution of 32 \(\times\) 32 pixels for both online and offline samples. Subsequently, the dataset was randomly divided into training and validation sets at a ratio of 4:1, yielding 1320 samples for training and 330 samples for validation. The trained model was designed to identify and locate actual damage within the input online images.