Abstract
Crack detection is critical for guaranteeing the safety of bridges, railways, and other infrastructures; however, it is a difficult task, particularly for tunnels. Tunnel lining images are primarily acquired using vision sensors, and cracks typically appear throughout an entire image. For crack detection using convolutional neural networks, the recognition accuracy is unsatisfactory when the cracks are at the edge of the image. Hence, an image preprocessing method is proposed to process railway tunnel data. In this method, the relative position of cracks in an image is changed by adding different sizes of borders to the crack images, and four different detection models are used for training to examine the effectiveness of the preprocessing method. Experimental results show that the proposed preprocessing method achieves better detection results for all four models. In the custom dataset, the border size is set to 1/9 of the original image size, which is the most effective size for improving edge crack recognition, where a maximum improvement of 8.4% compared with the control group is achieved. Additionally, black pixels (pixel value 0) are used to fill the border, which is better than using white pixels (pixel value 255).
Introduction
Automating the inspection of railway tunnels is a significant data-driven challenge. High-speed cameras mounted on inspection vehicles capture over 10,000 images per kilometer. While Convolutional Neural Networks (CNNs) have proven highly effective at identifying structural defects, they exhibit a notable weakness: a struggle to accurately detect objects located at the extreme edges of an image.
In a tunnel environment, cracks can appear anywhere within the camera's field of view. Standard neural networks often lose spatial context at boundaries during successive layers of convolution, leading to missed detections or low-confidence predictions for edge-bound cracks. This "edge effect" poses a risk to comprehensive safety monitoring. This paper proposes a preprocessing method to mitigate this issue by artificially shifting edge features toward the center of the processing frame.
Methodology
The proposed preprocessing pipeline aims to "center" edge features through a series of steps:
- Grayscale Conversion: Standardizing input data to reduce computational complexity.
- Border Padding: Adding a border around the original image. This effectively shifts cracks previously at the edge toward the center of a new, larger image, where the CNN's feature extraction is most robust.
- Coordinate Recalculation: Adjusting ground-truth bounding box labels to match the new image dimensions.
- Fill Strategy: The researchers evaluated two pixel values for the border: black (0) and white (255).
To validate the effectiveness of this approach, the YOLOv5s architecture was employed. The study specifically investigated how preprocessing interacted with different mathematical "triggers" by testing four distinct activation functions: SiLU, Tanh, ReLU, and LeakyReLU.
Datasets and Experimental Setup
The study utilized a combined dataset of 1,744 images, comprising the public Crack Forest Dataset (CFD) and custom tunnel lining images acquired from actual railway infrastructure. Data augmentation techniques, including flipping and rotation, were applied to prevent overfitting. The final dataset was split into 1,494 training images and 250 validation images.
Key Insights
- The 1/9th Rule: Testing various border sizes (1/10, 1/9, 1/8, and 1/7 of the original dimensions) revealed that 1/9 is the optimal ratio. Smaller borders failed to fully mitigate boundary effects, while larger borders diluted the model's focus by making the actual crack features too small relative to the total image area.
- Optimal Fill Value: Filling the border with black pixels (value 0) consistently outperformed white pixels (value 255). High-intensity white borders likely create extreme contrast transitions that distract the model or introduce artificial features that interfere with subtle crack textures.
- Activation Sensitivity: The "Tanh" activation function showed the most significant improvement. While Tanh can struggle with convergence in complex scenes, moving targets away from the edges provided the necessary stability for improved performance.
Results and Discussion
The results across all four model variations demonstrated that adding a border improved detection metrics, particularly under strict evaluation criteria.
- Maximum Improvement: The Tanh-based model saw an 8.4% increase in mAP@50:95 when using a 1/9 black border compared to the control group.
- Top Performer: The ReLU-based model achieved the highest overall accuracy, reaching a 95.0% mAP@50.
- High IoU Success: Preprocessing was most effective at improving results for "High IoU" (Intersection over Union) conditions. This indicates that the model not only detected cracks more frequently but also localized them with significantly higher precision.
Conclusion
The proposed image preprocessing method provides a simple yet effective solution for the "edge effect" in tunnel crack detection. By adding a black border of 1/9 the original image size, structural flaws at the edges are brought into the network's optimal feature extraction zone. While effective for YOLOv5, future work could explore the applicability of this "border trick" to newer architectures like Vision Transformers (ViTs), which handle spatial relationships differently.
Summary updated