Abstract
Structural Health Monitoring (SHM) techniques are essential for identifying structural defects and damages to optimize maintenance and repair schedules. While automated vision-based damage detection systems have been explored in the past, their reliability and deployment challenges in real-world scenarios have limited widespread adoption in structural inspections. This research presents an innovative approach to SHM by leveraging advanced Deep Learning (DL) techniques to overcome persistent challenges in automated vision-based damage detection systems. This paper introduces a novel application of Pix2Pix, a Conditional Generative Adversarial Network (CGAN), designed for efficient and precise crack detection and localization in concrete bridges. The approach is centered on a robust DL model trained on an extensive and diverse dataset of cracked concrete and asphalt pavement surfaces. Streamlined workflow of the proposed system enables rapid processing and generates highly accurate representations of detected cracks in under 0.7 seconds, significantly enhancing real-time monitoring capabilities. To demonstrate practical applicability, a user-friendly prototype application was developed for detecting deterioration in concrete and asphalt pavement surfaces. This tool not only identifies existing damage but also supports longitudinal studies by enabling comparisons with previous assessments for crack propagation behavior analysis. The proposed system’s ease of use and automation capabilities make it a promising solution for large-scale structural inspections, offering a significant step forward in the field of SHM.
Keywords
Introduction
Concrete bridges are critical components of urban transportation infrastructure, and their regular inspection and maintenance are essential for ensuring optimal operation. Traditional methods for condition assessment, such as visual inspections, hammer tapping, and chain dragging, have been widely used for detecting surface defects like delamination and voids (Luleci et al., 2022). While these methods are straightforward, they are highly subjective, labor-intensive, and time-consuming, often leading to inconsistent results (Hsieh et al., 2020). Moreover, they are limited in their ability to detect underlying deterioration and quantify damage severity, which are crucial for effective maintenance planning (Saidin et al., 2022). These limitations have spurred the development of automated inspection techniques that leverage advanced computational methods.
The rest of the paper is organized as follows. The “Literature Review” section provides an overview of existing research on crack detection in concrete and asphalt surfaces, with a focus on ML, DL, and Generative AI techniques. In “Methodology for Pix2Pix-based Crack Detection,” we provide details regarding the development of a Conditional Generative Adversarial Network (GAN) for pavement crack detection. The “Experiments” section outlines the procedures employed in the development and testing of our AI model. “Observations” presents key insights gained during the model’s testing phases. In “Performance Evaluation,” we introduce a novel metric for assessing model performance, while also discussing the application of established metrics in our research. The “Results and Discussion” section provides a detailed analysis of our findings. “Prototype Software” describes the development of an application that integrates our model for practical industrial use. “Conclusions” summarizes the key contributions and limitations of our study, offering insights for future research directions.
Literature review
Machine learning
To address the subjectivity and inefficiency of traditional methods, researchers have explored ML-based approaches for crack detection. For instance, Support Vector Machines (SVM) have been employed for crack image analysis, but they often produce discontinuous detections and struggle with minor surface imperfections (Mir et al., 2022). While SVM-based systems like those proposed by (Gavilán et al., 2011; Li et al., 2009) have improved linear feature extraction and crack width classification, they remain computationally expensive and require advanced equipment. Similarly, CrackForest (Shi et al., 2016) introduced random structured forests to reduce noise and learn crack patterns, but it often misclassifies non-crack regions and lacks precise localization capabilities. These ML-based methods, while promising, fall short in terms of accuracy, scalability, and real-time applicability, highlighting the need for more advanced techniques.
Deep learning
DL techniques have emerged as a powerful alternative to traditional ML methods, offering superior performance in crack detection and segmentation. Convolutional Neural Networks (CNNs) have been widely adopted for structural damage detection, demonstrating remarkable results across various structures, including bridges, tunnels, and pavements (Ye et al., 2019). For instance (Yu et al., 2022), utilized YOLOv5 for crack detection in concrete bridges, but the generated bounding boxes lacked detailed crack shape information. Similarly (Deng et al., 2020), employed an Atrous Spatial Pyramid Pooling (ASPP) module to enhance pixel-level crack detection, while (Dung and Anh, 2019) used pre-trained architectures like VGG16 and ResNet for semantic segmentation. Despite their advancements, these methods often require extensive computational resources and struggle with complex scenes, variable lighting, and fine crack detection.
(Arafin et al., 2024) employed various CNN architectures for both classification and segmentation tasks for performing automatic damage detection. However, improvements need to be made in the approach to neglect vegetation and traffic signs during inspections (Choi et al., 2024). proposed an automatic concrete crack detection system using ResNet for crack classification and, coupled with a clustering technique, facilitated the quantification of crack proportion for damage level assessment (Sohaib et al., 2024). proposed a novel ensemble approach using multiple quantized YOLOv8 models for crack segmentation, achieving faster inference times under 27 milliseconds. However, YOLOv8’s inherent smoothing during mask generation erodes fine edges, artificially generating uniformity in crack width. The approach still requires some fine-tuning to accurately determine crack boundaries for crack dimension measurement. CrackU-net (Huyan et al., 2020) was proposed as specialized architecture for pixel-wise crack detection in pavement images by incorporating contextual information and spatial relationships in the surface. PCSNet (Liang et al., 2024), a lightweight CNN for crack detection and segmentation in asphalt pavement was proposed, which utilized an enhanced shuffle unit, improved inverted residual architecture, and gradient-based class activation mapping for improved prediction accuracy and model interpretability. MOACA-CrackNet was proposed by (Wang et al., 2023) to automate damage detection in concrete structures by combining a multi-frequency encoder with a cross-attention mechanism. Although it enhanced model generalizability and segmentation accuracy for various crack features, research needs to be conducted to augment its performance in complex scenes with variable lighting. For accurately segmenting fine cracks in bridge images with complex backgrounds (Liu et al., 2022), proposed BC-DUnet, which exhibited superior performance and generalizability with the implementation of a three-part architecture incorporating Densely Connected Feature Extraction, Background Elimination, and Cross-Attention Mechanism modules. Automated pavement condition assessment via pixel-level distress detection was proposed with the development of W-SegNet by (Zhong et al., 2022). The network employed two symmetric encoder-decoder architectures by incorporating location information and distress classification streams and concatenating their features to leverage local details and provide broader context. While these approaches have pushed the boundaries of crack detection, they still face limitations in real-time applicability and industrial deployment, particularly in terms of inference speed and ease of integration into existing inspection workflows.
Generative adversarial networks
GANs have gained attention in SHM for their ability to address data scarcity and enhance defect detection. Unlike CNNs, which primarily focus on classification and segmentation, GANs excel in data augmentation, generation, and image-to-image translation. For instance (Shin et al., 2021), used GANs to augment datasets of old structures, while (Sun et al., 2022) employed Super-Resolution GANs to enhance low-resolution images for structural displacement quantification. Additionally (Zhang et al., 2020), proposed a self-supervised image-to-image translation framework using GANs to generate crack masks from images and vice versa. A novel approach for unsupervised defect detection was proposed by (Rastin et al., 2021) with the use of a novel two-stage method, which encapsulated a Deep Convolutional GAN (DCGAN) in the first stage for measuring structural defects, and a Conditional GAN (CGAN) in the second stage for damage localization. Despite these advancements, GANs have predominantly been used for data augmentation rather than direct defect detection, leaving a gap in their application for real-time, on-site inspections.
Research gaps and proposed approach
While DL and GAN-based methods have significantly advanced crack detection, several gaps remain. First, most existing approaches are computationally intensive and lack real-time inference capabilities, making them unsuitable for on-site inspections. Second, the majority of studies have been conducted in controlled environments, raising questions about their applicability in diverse, real-world scenarios. Third, there is a lack of user-friendly tools that integrate these advanced techniques into practical inspection workflows. Finally, while GANs have shown promise in data augmentation, their potential for direct image-to-image translation in defect detection remains underexplored.
To address these gaps, this research proposes a novel approach leveraging Pix2Pix, a Conditional Generative Adversarial Network (CGAN), for real-time crack detection and segmentation. Pix2Pix is uniquely suited for this task due to its ability to perform direct image-to-image translation, generating highly accurate segmentation masks from crack images. By training the model on a diverse dataset of concrete and asphalt surfaces, we aim to develop a robust system capable of detecting and localizing cracks with high precision. Furthermore, we introduce a prototype software application designed to streamline the inspection process, enabling real-time damage assessment and longitudinal studies of crack propagation. This approach not only enhances the accuracy and efficiency of structural inspections but also bridges the gap between advanced DL techniques and practical industrial applications.
Methodology for PIX2PIX-based crack detection
The methodology can be divided into three stages for simplicity. Stage I is to establish a dataset for crack detection on concrete and asphalt pavement surfaces, and relevant preprocessing and preparation techniques required for training the network. The replicability of crack detection experiments and results is hindered by the scarcity of benchmark datasets. Publicly available datasets serve as a valuable substitute in this situation. Hence, concrete and asphalt pavement crack images and their pixel-wise segmentation masks from Concrete Crack Conglomerate dataset were finalized for the training step. Preprocessing techniques, such as resizing the images to 256 × 256 resolution, color inversion of segmentation masks for coherence, and combining images with their respective masks into single images, were performed. Stage II aims to train the Pix2Pix network for establishing a mapping between the crack image and its translation for crack detection and localization. Stage III aims to test the developed model on a diverse set of images and evaluate its performance using an appropriate metric (Figure 1). Methodology for the study.
Basics of CGAN
A CGAN is a variant of the standard GAN that is conditioned on some additional information or input, typically in the form of segmentation masks, class labels, text description, etc. Both the generator and discriminator are trained on this additional information for the conditional generation of desired data. The generator takes random noise and the conditioning information as input and produces synthetic examples of the target domain, while the discriminator takes both real samples of the source domain and corresponding conditioning information to classify the generated examples as real or fake. In doing so, the generator attempts to minimize the log-likelihood of the discriminator by producing samples that can be classified as real by the discriminator. The objective function for a CGAN is expressed as follows:
Architecture of Pix2Pix
Predominantly designed for image-to-image translation tasks by (Isola et al., 2017), Pix2Pix is well-suited for tasks where a mapping exists between source and target domains, such as black-and-white photos to color, facades to buildings, or converting satellite images to maps.
The network architecture is composed of a discriminator (D), illustrated in Figure 2 and a generator (G), illustrated in Figure 3. The generator is based on a UNET encoder-decoder architecture, with the encoder downsampling the input image and extracting its features, and the decoder upsampling the encoded features to generate the output image. Rather than extracting a point from the latent space as input, dropout layers are employed to provide randomness during training and inference stages. Corresponding layers in the encoder are connected to the layers in the decoder via skip connections with precisely similar-sized feature maps to preserve the details from the input image. Dropout layers are additionally utilized during training and inference, as well as, batch normalization. This ensures that the generator always operates in training mode. Blocks of Convolution – Batch Normalization – LeakyReLU are used in the encoder, and Convolution – Batch Normalization – Dropout – ReLU blocks in the decoder. Bottleneck layer is implemented as the last layer of the generator without the use of batch normalization or leaky ReLU activation. The convolutional layers used a filter size of 4 × 4 with a stride of 2 × 2. The generator is also fed with a conditional map or label to establish a conditioning that assist the network in generating the images of the desired characteristics or domain. The discriminator is a binary classification model, i.e. the output is predicted as a probability in the range [0, 1]. It determines whether the generated image is a plausible representation of the target domain or not by distinguishing between the real and generated image pairs, i.e. (real input, real target) and (real input, generated target). Pix2Pix discriminator. Pix2Pix generator.

As with the generator, the discriminator is also fed with the conditional label along with the input images. The PatchGAN discriminator is configured with blocks of Convolution – Batch Normalization - ReLU layers with filters of size 4 × 4 applied with a stride of 2 × 2. By applying a PatchGAN architecture, the discriminator focuses in the local image details, i.e. patches of 70 × 70 resolution or 2D grids, rather than the entire image. It implements three layers regardless of the size of the image provided. These layers do not include the output and second last layers. The discriminator is run convolutionally across the whole image, with the output being the average of results obtained from all patches. A fixed stride of 2 × 2 in all but the output and second last layers and a fixed kernel size of 4 × 4 is used.
Dataset of crack images
Since benchmark datasets for crack detection do not exist, a publicly available dataset, namely, Concrete Crack Conglomerate dataset (Bianchi and Hebdon, 2021) was used for the proposed methodology. The dataset is a collection of various concrete crack datasets from literature, combined into a single comprehensive dataset. It contains a wide variety of crack patterns, sizes, and textures in surfaces like smooth and rough concrete, recently laid and worn out asphalt pavement, and worn out mosaic floor, ensuring that the trained models are capable of accurately detecting cracks in visual inspections. It contains 10,995 diverse crack images of 448 × 448 resolution. The test set constitutes 1096 images of crack and non-crack surfaces of concrete and asphalt pavement. Depending on the architecture of choice, the images need to be preprocessed before being fed to the model.
Preprocessing
Training Pix2Pix required that some preprocessing steps were performed on the dataset in order to satisfy the requirements of the network. The resolution of all images needed to be scaled down to 256 × 256. Furthermore, acquired segmentation masks needed to be color inverted for coherence. Finally, the images needed to be paired with their respective masks since Pix2Pix accepts input in the form of image pairs of source and target domain, as illustrated in Figure 4. Crack image-mask pair.
Training and testing the network
A Pix2Pix model was trained for 200 epochs on the training set of the Conglomerate Concrete Crack dataset. Unlike traditional CNN models, Pix2Pix has to be trained in an unconventional manner. Both the generator and discriminator models are trained simultaneously in an adversarial behavior, where the generator attempts to deceive the discriminator and the discriminator tries to outwit the generator by accurately identifying synthetic counterfeit image samples. Hence, an unconventional training loop is implemented in which the generator is trained by the adversarial loss and the L1 loss, thereby encouraging it to synthesize better image translations of the provided input, which are received by the discriminator. The discriminator classifies if the received translations are real or fake.
For testing, training checkpoints were saved after every five epochs, from which the generator model was extracted. It was then tested on a pre-established dataset comprising of crack images with varying crack lengths and widths. The test set comprised 1096 photos, categorized into 12 groups, as illustrated in Figure 5. Each category pertained to a practical situation that the built model would face while detecting cracks. (a) Newly constructed roads may have smooth asphalt with narrow fissures, and it is crucial to prevent rapid propagation of these cracks. (b) The broad fissure in the rough asphalt surface presents a similar issue but with a coarse texture. (c) The presence of numerous fractures on the rough asphalt indicates significant deterioration of the road surface, necessitating patching or resurfacing to ensure smooth operation. The model had to operate well under different lighting situations, therefore (d) asphalt and (h) concrete surfaces with cracks under poor illumination were chosen. (g) Deterioration on newly built concrete walls appear in the form of narrow cracks breaking the upper surface, hence this surface was needed for model testing. (e) Paint is sometimes applied to the concrete surfaces of bridges. Cracks on this surface can be very difficult to spot due to their deviation from the uniform color of concrete, which is why they are included for training. Concrete walls typically feature geometric textures or are adorned with layers of bricks for aesthetic appeal. As these textures are applied on top of the concrete surface, cracks that are sealed spread from below to the top layer. Therefore, surfaces with (f) geometric textures and (l) bricked walls were added for training. (i) Concrete gets contaminated with fungus due to water infiltration. The seepage is primarily due to a leaky or corroding pipe located either inside or outside the concrete surface, or water running from a nearby structure onto the concrete. Fungus begins to develop in the affected area and is easily identified by a dark green coating next to the cracks. Therefore, this category was included in the dataset. Testing categories: (a) Smooth asphalt with a single narrow crack, (b) Rough asphalt with a single wide crack, (c) Rough asphalt with multiple cracks, (d) Smooth asphalt with cracks in harsh lighting, (e) Colored concrete wall with cracks, (f) Smooth concrete with textures, (g) Smooth concrete with single narrow crack, (h) Smooth concrete with single crack in harsh lighting, (i) Fungus-damaged concrete with crack, (j) Non-crack concrete surface, (k) Asphalt road crack with marking, (l) Brick surface with imperfections.
Performance evaluation
A CGAN generates a plausible translation of the input, i.e. an image of the target domain. Evaluating such an output presents a unique challenge as no existing direct quantitative metric (DeVries et al., 2019) can be utilized in this scenario. Rather, quality of the output has been measured. In order to determine the accuracy of crack detection and localization, structural similarity of the translated output and the training mask has to be compared at either the pixel or block-level.
A block can be described as a rectangular or square subset of pixels within the mask that is defined by its width and height and position within the image. Four Metrics, precision, recall, F1-score, and Mean IoU were adopted for detection evaluation at the pixel-level. Since traditional techniques do not account for structural information, i.e. spatially close pixels have strong inter-dependencies, for this reason, establishing similarity at a block-level, thorough experimentation was performed initially with pixel-wise comparison of crack regions, Template Matching (Hashemi et al., 2016), Normalized Cross Correlation (Tsai and Lin, 2003), Structural Similarity Index (SSIM) (Nilsson and Akenine-Möller, 2020), and considerable modifications in these techniques were experimented with to generate a plausible evaluation metric. However, considerable edge cases in each technique prompted the move to a completely bespoke evaluation metric. For evaluating model performance at block-level, a new metric, Crack Similarity Index (CSI), was then developed for comparing 32 × 32 blocks of the generated masks with their training counterparts.
Experiments
The following section elaborates the experimental procedure, training setting of the network, and hardware architecture of the workstation designated for training.
Hardware configuration
Hardware configuration.
Hyperparameter setting
The network was trained for 200 epochs, with training checkpoints saved after every five epochs. These checkpoints contain the exact values of all parameters of the model, graph of dependencies, index file, and current model state that contains model architecture, weights, and optimizer, which aid in restoring the training process in case of any power failure. It took an average of 17 minutes to train an epoch for the network.
Hyperparameters.
Qualitative experiments
During training, the generator was programmed to produce a plausible representation of detected crack in the image, if there were any, via a synthesized segmentation mask. It was plotted along with the crack image and its ground truth for visual inspection, as shown in Figure 6. The patterns produced could then be compared with the original training mask of that crack for qualitative evaluation. The visual comparison revealed the inherent behavior of the model during various stages of training, from which valuable observations were obtained. Training progress visualization.
Observations
Discussion of the testing process
The saved generator model at 20 successive epochs were selected for testing. The models were then tested on the 12 selected categories from the test set. While dissecting the models, discontinuity across the crack regions is evident, as illustrated by bounding boxes in Figure 7. In addition, the model generates blobs in regions with darker surface textures, as depicted by arrows. Furthermore, abnormal shaped patches are formed in ill-lit regions of non-crack surfaces, as presented by oval markings in Figure 7. As observed in the training stages, the model learns to identify and localize cracks gradually till 80 epochs. Model testing at epoch 20; O (original image), M (training mask), R (result).
During this phase, the principal skeleton of the cracks are localized, though with slight discontinuities. Additionally, formation of blobs begins to dilute, except for the fungus-infected surface. The model’s ability to localize cracks in harshly lit surfaces improves. This upward trend is observed by markings in Figures 8, 9 and 10. Model testing at epoch 40; O (original image), M (training mask), R (result). Model testing at epoch 60; O (original image), M (training mask), R (result). Model testing at epoch 80; O (original image), M (training mask), R (result).


The model accurately detects single narrow and wide cracks in concrete and asphalt surfaces due to their monochromatic nature on reaching 100 epochs, as illustrated by markings in Figure 11, though its issue with unfavorable lighting condition persists. The model’s capacity to identify non-existent cracks and avoid false alarms caused by geometric texturing seems to be evident. Halfway at 100 epochs, it can be established that both narrow and wide cracks, with or without branches, can be detected by the model. However, significant performance improvements are required for extremely narrow cracks in adverse lighting conditions. Model testing at epoch 100; O (original image), M (training mask), R (result).
In addition, the ability to discriminate between crack and non-crack surfaces is improved, thereby decreasing unnecessary crack formations. A highly unusual behavior is perceived at epoch 120, where crack localizations in almost all categories suddenly vanish, though false detections in brick surface diminish, as illustrated by the bounding box markings in Figure 12. Performance improvements are observed in non-crack surfaces at the expense of precise detections in surfaces with superior record. Throughout the course of the next 40 epochs, performance fluctuations are observed in almost every category, as if the model is unclear of the crack structure, as illustrated in Figures 13 and 14. The absence of arrow and oval markings in these Figures indicate that the model can accurately distinguish between surfaces containing cracks and those that do not contain any defect. Model testing at epoch 120; O (original image), M (training mask), R (result). Model testing at epoch 140; O (original image), M (training mask), R (result). Model testing at epoch 160; O (original image), M (training mask), R (result).


At 180 epochs, the model has reached its full potential as it can now detect any damage even on colored surfaces whilst also classifying crack-like textures as non-cracks, as shown in Figure 15. Slight deterioration in performance is noted at 200 epochs when narrow cracks in grim light cannot be accurately detected, as shown in Figure 16. Model testing at epoch 180; O (original image), M (training mask), R (result). Model testing at epoch 200; O (original image), M (training mask), R (result).

To conclude, at varying epochs in testing the model, it is apparent that the model has difficulty in detecting damage in harsh lighting scenarios where the cracks are hardly visible to the human eye. This scenario is not of a great concern since real-world inspections are performed in daylight, and that is where the model excels. Moreover, performance improvements are observed till 180 epochs, with the model fluctuating slightly before it ultimately matures.
Performance evaluation
GAN generator models are intentionally trained indirectly via the discriminator, making it challenging to objectively assess their performance. Various methodologies have been proposed to assess the merits and limitations of generator models (Borji, 2019), encompassing both qualitative and quantitative assessments. Qualitative evaluation involves the subjective assessment of generator models by human assessors, who evaluate their accuracy in producing high-fidelity images. Common qualitative evaluation techniques include nearest neighbors, quick scene categorization, preference judgment (Huang et al., 2017; Xiao et al., 2018), mode drop and collapse, and investigating and visualizing internals of a network. Due to their subjective nature, the conducted study did not take into account qualitative judgment. In contrast, quantitative evaluation involves the assessment of generated images’ quality through the utilization of numerical scores. These scores offer objective and replicable metrics of model performance. Metrics like Average log-likelihood (Goodfellow et al. nd; Theis et al., 2015), Inception Score, Fréchet Inception Distance (Heusel et al., 2017), Generative Adversarial Metric (Im et al., 2016) have been frequently utilized previously. However, these techniques were deemed unsuitable for our study due to the requirement of evaluating the generated crack mask with the training mask of the source image to assess structural similarity.
Pixel-level segmentation evaluation
As discussed in section 2.6, precision, recall, F1-score, and mean IoU were employed to evaluate the model’s segmentation abilities at the pixel-level. Precision measures the proportion of true positive predictions among all positive predictions, whereas Recall measures the proportion of true positive predictions among all positive samples. F1-score balances both precision and recall by utilizing the harmonic mean. Mean IoU, a widely used semantic segmentation metric, quantifies the accuracy of pixel-wise predictions be measuring the overlap between predicted and ground truth segmentation masks. These metrics are given by the following equations:
FP (False Positive) = Number of pixels wrongly classified foreground crack pixels, i.e. predicted as foreground, but are background pixels.
FN (False Negative) = Number of pixels inaccurately classified as background pixels, i.e. predicted as background pixels, but are foreground crack pixels.
TN (True Negative) = Number of correctly classified background pixels.
Block-wise segmentation evaluation
A customized assessment metric was devised for block-wise segmentation evaluation, which involves comparing the training mask with the output image on a block-wise basis. Given that the crack images had a resolution of 256 × 256, they were divided into 32 × 32 blocks for the purpose of comparison, resulting in a total of 64 blocks per image. Given that both images consisted solely of black and white pixels, with white pixels representing the crack region and black pixels representing the background, a set of criteria was established for comparing them block by block. The criteria outlined four conditions: • If both the training mask and generated image blocks comprised exactly the same number of background pixels, i.e. black pixels with no crack located in them, a block-wise similarity index value (BSI = 1) of 1 was calculated for that block. • If the training mask block comprised black pixels and the generated image block contained any white pixels, i.e. inaccurate detection made by the model, a block-wise similarity index value (BSI = 0) of 0 was calculated for that block. • If the training mask block comprised white pixels and the generated image block contained none, i.e. model failing to detect any crack present in that region, a block-wise similarity index value (BSI = 0) of 0 was calculated for that block. • If both the training mask and generated image blocks contained white pixels, simple Intersection over Union (IoU) was taken for that block (BSI = IoU).
IoU is expressed as:
Block_FN = White pixels generated as black pixels by the model
Block_FP = Black pixels generated as white pixels by the model
These values were then stored in a block-wise similarity matrix, as presented in Figure 17(b), and the final crack similarity index was computed by taking average of the calculated values of the image blocks. The evaluation process can be mathematically described as: Crack similarity index; (a) training mask and generated image visualization, (b) block-wise similarity matrix. Crack Similarity Index evaluation.


Results and discussion
Performance of the developed model was evaluated via two approaches, firstly by comparing the segmentation performance of Pix2Pix with five concrete and pavement segmentation models, namely, MOACA-CrackNet (Wang et al., 2023), BC-DUnet (Liu et al., 2022), CrackU-net (Huyan et al., 2020), PCSNet (Liang et al., 2024), and W-segnet (Zhong et al., 2022), and secondly by dissecting the categorical performance of Pix2Pix on the test set.
Comparison experiments
Segmentation performance comparison.

Comparative performance evaluation metrics; (a) Precision, (b) Recall, (c) F1-score, (d) mIoU.
This in turn leads to a segmentation performance improvement of around 10% when compared with BC-DUnet and CrackU-net. Through comparative experiments, it is determined that average mIoU performance of Pix2Pix trails that of MOACA-CrackNet by a margin of 8%, while BC-DUnet is the other model with a comparable mIoU score to Pix2Pix, as shown in Figure 19(d). MIoU scores indicate that CrackU-net, PCSNet, and W-segnet slightly fluctuate in performance, which stipulates that segmentation performance improvements can be made with better feature extraction steps. Pix2Pix’s higher precision of 91.02% and F1-score of 89.50% reflect its strength in minimizing false positives while maintaining robust crack detection, which is critical for avoiding unnecessary repair costs and preventing structural over-intervention. The recall gap 87.10% versus 93.56% stems from MOACA-CrackNet’s prioritization of broad coverage, which increases false positives in noisy environments. In safety-critical contexts like that of bridge inspections, precision outweighs recall – missing minor cracks is preferable to misclassifying sound concrete as damaged.
In summary, Pix2Pix achieves a similar detection and segmentation performance with advanced DL architectures on concrete and asphalt pavement crack images with complex backgrounds and environments with harshly lit surfaces. The low variability in the conventional evaluation metrics indicate that it is stable and reliable in generating accurate segmentation masks in real-world scenarios.
Categorical performance evaluation
Performance results for crack detection.
Category-wise performance results.

Category-wise performance results; (a) Smooth asphalt with a single narrow crack, (b) Rough asphalt with a single wide crack, (c) Rough asphalt with multiple cracks, (d) Smooth asphalt with cracks in harsh lighting, (e) Colored concrete wall with cracks, (f) Smooth concrete with textures, (g) Smooth concrete with a single narrow crack, (h) Smooth concrete with a single crack in harsh lighting, (i) Fungus-damaged concrete with crack, (j) Non-crack concrete surface, (k) Asphalt pavement with marking, (l) Brick surface with imperfections.
For smooth concrete with textured surface, highest similarity index of 99.9% is obtained at epoch 120, which reflects in its ability to differentiate cracks from geometric and sophisticated textures, as illustrated in Figure 20(f). For smooth concrete with a single narrow crack, highest similarity index of 90.78% is calculated at epoch 180. A relatively good score is obtained across the board reflecting the model’s excellent detection capabilities in this surface, as depicted in Figure 20(g). For smooth concrete with a single crack in harsh lighting, highest similarity index if 83.4% is obtained at epoch 100, as illustrated in Figure 20(h). Twice, the evaluation results at epoch 100 have produced better detection scores in harsh illumination for both concrete and asphalt across the board. This indicates that the model performs reasonably well in detecting cracks in minimal lighting at this epoch. Fungus-damaged concrete surface appears to be the Achilles heel of the model as the highest similarity index of 89.9% is obtained at epoch 160, as shown in Figure 20(i), but significantly lower scores at other epochs indicate that cracks are significantly harder to detect when the surface damage is covered by corrosion.
The model is able to identify when the surface is intact and does not contain any deterioration with ease. This is reflected by multiple similarity indices of 100% at more than one epoch, as illustrated in Figure 20(j). For asphalt pavement with markings, highest similarity index of 90.9% is obtained at epoch 100.
A threshold of 80% is breached consistently by the model at every other epoch, stipulating that the model has accurately learned to differentiate cracks from road markings, as illustrated in Figure 20(k). When presented with brick-layered surfaces to the model, a highest similarity index of 100% is obtained at multiple epochs, indicating that the model does not identify brick defects or missing bricks as potential cracks, as illustrated in Figure 20(l). When comparing the evaluation results, models at two epochs, namely epoch 100 and 180, perform detections with relatively high accuracy in almost all categories. The model at epoch 100 excels in harsh lighting scenarios, while the model at epoch 180 is proficient in every other category. At epoch 100, mid-level convolutional layers that specialize in detecting minute textural differences and edges peak in responsiveness. This enhances performance in low-light scenarios where crack delineation relies on local contrast rather than global context. By epoch 180, deeper layers that capture structural semantics mature, improving holistic accuracy but potentially over-smoothing fine details in high-noise environments. The performance fluctuations observed before epoch 200 are characteristic of adversarial training dynamics in Pix2Pix models, where the generator and discriminator continuously adapt to each other, causing oscillations in performance metrics. This describes the reason that the model at epoch 100 performs better under harsh lighting conditions, likely because earlier training stages preserve contrast features important in low light, while the epoch 180 model refines overall segmentation quality for other categories.
Prototype software
A prototype software application was developed to integrate the trained Pix2Pix model into a practical, user-friendly tool for real-time crack detection. Built using Flet, a language-agnostic framework powered by Flutter (Google’s open-source framework for cross-platform development), the application is designed to streamline the inspection process and enhance the efficiency of structural health monitoring. The application features an intuitive interface that simplifies crack detection, making it accessible even to non-technical users, such as field inspectors. The application encapsulates the following key features:
User-friendly interface
The application launches a file explorer when the user clicks the “Select Image” button, allowing them to choose an image from a designated directory. This seamless interaction ensures ease of use, even for inspectors with limited technical expertise. As shown in Figure 21(a), the selected image and its corresponding crack detection mask are displayed side-by-side in two containers, providing immediate visual feedback. Prototype application interface; (a) Image selection for crack detection, (b) Crack detection result.
Real-time crack detection
Upon image selection, the model is loaded into memory, and the image undergoes preprocessing to prepare it for input. The image is resized to a resolution of 256 × 256, normalized to the range of [-1, 1], and expanded in dimensions to meet the model’s requirements. The model generates a binary mask representing the detected cracks, which is then rescaled to the original image dimensions for accurate visualization. This entire process is completed in less than 1 second, enabling real-time crack detection during on-site inspections.
Automated documentation and visualization
The application automates the traditionally labor-intensive process of documenting structural damage. Detected cracks are saved as high-quality PNG files, which can be stored locally for record-keeping and future reference. This feature not only eliminates the need for manual documentation but also facilitates longitudinal studies by allowing inspectors to compare current and past crack images, providing valuable insights into crack propagation over time.
Crack dimension calculation
In addition to crack detection, the application supports crack dimension calculation, enabling inspectors to quantify the severity of damage. This capability enhances the qualitative nature of inspections by providing quantitative metrics for decision-making.
In addition, the developed application addresses several critical challenges in conventional structural inspections: • • • •
Furthermore, the industrial implications of this application are immense. It bridges the gap between advanced deep learning techniques and practical industrial use. By integrating the Pix2Pix model into a user-friendly tool, it empowers inspectors to perform accurate, real-time crack detection without requiring specialized technical knowledge. The automated documentation and visualization features further enhance its utility, making it a valuable asset for structural health monitoring in real-world scenarios.
Conclusions
This paper presents a streamlined, vision-based approach for crack detection and localization on concrete and asphalt pavement surfaces, leveraging the Pix2Pix architecture, a Conditional Generative Adversarial Network (CGAN). By training the model on a dataset of 9899 paired crack images and their corresponding segmentation masks, and testing it on 1096 images across 12 categories, we demonstrated the effectiveness of this approach in real-world visual inspection scenarios. A bespoke evaluation metric was developed to rigorously assess the model’s performance, ensuring its suitability for practical applications. Based on the findings of this research, the following conclusions can be drawn: • The Pix2Pix architecture proved to be a highly viable and robust solution for crack detection and localization. Its ability to generate accurate and visually isomorphic translations of detected cracks makes it particularly well-suited for tasks requiring consistent and precise outputs, such as structural health monitoring. While the model’s limited generalization capability restricts its use in scenarios requiring diverse outputs, it excels in applications like crack detection, where output consistency is critical. However, the approach is contingent on the availability of paired source-target images for training, and its training duration is longer compared to traditional CNN-based methods due to the complexity of its adversarial architecture. • The proposed model achieved exceptional performance in the semantic segmentation of crack images, attaining a precision of 91.02% and an F1-score of 89.50%. These results underscore the model’s ability to accurately identify and localize cracks, even in complex and varied surface conditions. The high precision and F1-score highlight the model’s reliability and its potential to reduce false positives and false negatives in crack detection tasks. • The model demonstrated remarkable generalization capabilities, achieving an average crack similarity index of 85% across a wide range of concrete and asphalt pavement surfaces. This performance indicates its robustness in detecting damaged regions under diverse conditions, making it a versatile tool for structural inspections. • To bridge the gap between research and practical application, the model was integrated into a prototype software application designed for real-time inspections. The application enables inspectors to detect and document cracks with unprecedented speed and accuracy, completing inferences in less than 1 second. This real-time capability, combined with automated documentation and visualization features, significantly enhances the efficiency and reliability of structural inspections, reducing the time and effort required for manual assessments.
While the proposed approach demonstrates significant strengths, there are areas for further improvement. The model’s performance in environments with extreme lighting conditions, such as excessive sunlight or inadequate lighting, can be enhanced through additional research. Furthermore, the impact of surface markings, random textures, or patches on crack detection accuracy needs to be addressed to improve the model’s robustness in real-world scenarios.
Footnotes
Acknowledgements
The support provided by the Department of Civil Engineering, Department of Computer and Information Systems Engineering, and NED University Virtual Reality Center at NED University of Engineering & Technology, Karachi, Pakistan is duly acknowledged by the authors.
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was funded by the Higher Education Commission (HEC), Pakistan [CPEC-Project # 178].
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Data Availability Statement
The authors confirm that the data supporting the findings of this study are available and/or referenced within the article.
