Leveraging a deep learning generative model to enhance recognition of minor asphalt defects
Abstract
This work has been co-financed by the Ministry of Science and Innovation (ES) through the State Plan for Scientific and Technical Research and Innovation 2021-23 under the project MAPSIA [TED2021-129749B-I00]. Also, by the Horizon Europe Research and Innovation Framework program of the European Union under the project LIAISON [101103698].
Full text
Leveraging a deep learning generative model to enhance recognition of minor asphalt defects Saúl Cano-Ortiz1,3, Eugenio Sainz-Ortiz1,3, Lara Lloret Iglesias2,3, Pablo Martínez Ruiz del Árbol2,3 & Daniel Castro-Fresno1,3 Deep learning-based computer vision systems have become powerful tools for automated and costeffective pavement distress detection, essential for efficient road maintenance. Current methods focus primarily on developing supervised learning architectures, which are limited by the scarcity of annotated image datasets. The use of data augmentation with synthetic images created by generative models to improve these supervised systems is not widely explored. The few studies that do focus on generative architectures are mostly non-conditional, requiring extra labeling, and typically address only road crack defects while aiming to improve classification models rather than object detection. This study introduces AsphaltGAN, a novel class-conditional Generative Adversarial Network with attention mechanisms, designed to augment datasets with various rare road defects to enhance object detection. An in-depth analysis evaluates the impact of different loss functions and hyperparameter tuning. The optimized AsphaltGAN outperforms state-of-the-art generative architectures on public datasets. Additionally, a new workflow is proposed to improve object detection models using synthetic road images. The augmented datasets significantly improve the object detection metrics of You Only Look Once version 8 by 33.0 % , 3.8 % , 46.3 % , and 51.8 % on the Road Damage Detection 2022 dataset, Crack Dataset, Asphalt Pavement Detection Dataset, and Crack Surface Dataset, respectively. Keywords Conditional generative model, Minor asphalt defect recognition, Data augmentation, Object detection, Road maintenance As essential elements of civil infrastructure, asphalt pavements undergo degradation over time due to heavy traffic, unpredictable weather, poor construction practices, sub-optimal material quality, and inadequate maintenance1. The degradation of road conditions leads to the emergence of surface defects like cracks or potholes that worsen over time. Then, regular pavement inspection and proactive maintenance are crucial for ensuring driving safety and serviceability2. In fact, effective identification of asphalt pavement defects and timely maintenance measures at an early stage can significantly reduce economic expenditure and carbon emissions3. In recent years, the advancement of deep learning algorithms applied to computer vision tasks has attracted great attention in civil engineering, specifically in the field of automatic asphalt pavement distress recognition4. The advent of modern, cost-effective vehicle-mounted cameras and advancements in technological infrastructure have spurred research into computer-aided visual inspection techniques. The investigation focuses on three computer vision applications mainly using deep convolutional neural networks-based models: classification, segmentation, and object detection. Classification assigns a single label to the entire image, segmentation provides pixel-level classification, and object detection combines location of multiple defects (bounding boxes) and their categories (distress types). Computer vision-based studies primarily concentrate on identifying common or most encountered types of asphalt road surface cracks (e.g., longitudinal, transverse, block, or alligator). However, the performance of deep learning-based algorithms is constrained by the limited ability to detect minor defects, which are also significant for road maintenance5. Concerning asphalt road damage detection, the more serious the distress, the 1GITECO Research Group, University of Cantabria, 39005 Santander, Spain. 2Institute of Physics of Cantabria, UCCSIC, 39005 Santander, Spain. 3These authors contributed equally: Saúl Cano-Ortiz, Eugenio Sainz-Ortiz, Lara Lloret Iglesias, Pablo Martínez Ruiz del Árbol, and Daniel Castro-Fresno. email: [email protected]; [email protected] OPEN Scientific Reports | (2024) 14:28904 1 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports
more difficult to collect the data. For instance, potholes, a prominent and severe road distress, are challenging to collect as they tend to be promptly repaired6. Also, sealed cracks are not usually analysed, and their recognition is crucial because they prevent water infiltration, which, when left unattended, can lead to structural damage and and a reduction in road service life7. There are also less common cracks, such as isolated cracks with diagonal/ oblique and irregular geometry, often overlooked in research but are essential to address before their severity escalates. The initial challenge lies in identifying these minor defects to improve the robustness of detection models. In real-world civil engineering scenarios, obtaining high-quality annotated large-scale data for long-tail defects is often challenging8. Deep learning-based classification, segmentation, and object detection algorithms are inherently data-driven, requiring balanced and sufficient data for optimal performance. Most studies propose complex architectures for pavement crack recognition, such as OUR-Net9 or RHACrackNet10, but they do not consider the importance of having a large volume of diverse, high-quality data. These limitations pose challenges in engineering practice, particularly in reducing overfitting and enhancing recognition11. A potential solution to these challenges is data augmentation, which can amplify the representation of rare asphalt pavement distresses. Traditional methods, such as affine transformations12 (e.g., rotation or translation), are effective for datasets with balanced distributions but may only add minor artifacts to existing images without introducing new perspectives or content, thereby limiting intra-class diversity for tail images13. In contrast, generative models offer the capability to generate entirely new data that closely resembles the probability distribution of real images, surpassing traditional methods14. However, there is limited research focusing on applying generative models for synthetic data augmentation to improve supervised models, particularly in the context of object detection. In the following, an analysis of the current state-of-the-art will be conducted. The most widely used generative architectures in the field of asphalt defect synthesis are Variational Autoencoders (VAE)15 and Generative Adversarial Networks (GAN)16. The VAE uses an encoder network to map data to a latent space and a decoder to generate data from the latent space. A GAN consists of a generator network that produces fake data and a discriminator that distinguishes between real and generated data. Multiple enhanced GAN variants have been investigated such as Deep Convolutional GAN (DCGAN)17, Wasserstein GAN (WGAN)18, WGAN with Gradient Penalty (WGAN-GP)19, Progressive GAN (PG-GAN)20, superresolution GAN (SRGAN)21, conditional GAN (cGAN)22, and cycle-consistent GAN (CycleGAN)23. Mazzini et al.24 addressed the challenge of obtaining costly semantic segmentation ground truths by proposing a WGAN-GP-based method for augmenting datasets in semantic segmentation. Also, an iterative image retrieval system was proposed to match real images. Similarly, a method called ConnCrack25 was proposed by exploring a WGAN. The generator of WGAN was designed to produce crack connectivity maps, while the discriminator checked if the maps and the original patch, were a real or a fake pair. Zhang et al.26 proposed CrackGAN, a DCGAN trained with crack ground truth patches. The augmented dataset proved to improve the segmentation performance of an asymmetrical U-Net. Gao et al.27 implemented a DCGAN with Leaf-Bootstrapping to generate synthetic frames to enhance a classification system. The LB method improves GAN performance by minimizing intra-class variation, allowing the generation of higher-quality images and ensuring better training stability. Pei et al.28 trained a VAE encoder and utilized its pre-trained encoder to generate a feature map, which was then connected with DCGAN. DCGAN was employed to generate localized crack images. The effectiveness of the augmented dataset was validated through an image classification task. Maeda et al.6 examined a PG-GAN to generate local synthetic images of potholes. Subsequently, larger defect-free road images were merged with the generated potholes, manually using Poisson blending, to improve object detection algorithm. Sim et al.29 utilized an SRGAN for upscaling smaller images and implemented a semi-supervised learning approach based on an encoder-decoder architecture to enhance crack segmentation. Salaudeen et al.30 proposed an enhanced SRGAN, trained with bounding-box pothole croppings to enlarge the dataset and improve pothole detection. The synthetic samples were hand-labelled and then, validated using YOLOv5 and EfficientDet. Chen et al.31 and Hou et al.32 suggested augmenting high-texture asphalt pavement using WGAN-GP architectures and expanded data for binary pavement texture image classification. Xu et al.33 introduced a DCGAN to generate synthetic crack images from cropped drone frames and augmented the dataset for crack classification using a VGG16-based network. Analogously, Que et al.3 developed a DCGAN to augment a crack-based dataset to enhance pavement distress classification. Song et al.34 proposed a CycleGAN to create shadowed images of pavement cracks. The approach was validated with U-Net trained with enlarged dataset, in terms of binary segmentation. Liu et al.35 explored a lightweight DCGAN incorporating squeeze-and-expand, multi-scale, and depth-wise modules for augmenting cracks and other defect types (pothole, patch, background). The effectiveness was validated through a classification task. Xu et al.5 trained DCGAN to generate segmentation masks for various distress types (pothole, sealed crack, crack, distress-free). These masks and distress-free images were used to train a VAE concatenated with a discriminator to produce merged images. Zhang et al.13 developed a DCGAN to create synthetic images, enhancing binary crack segmentation performance with a self-attention U-Net. Likewise, Pan et al.36 introduced CrackSegAN, employing a U-Net-based generator and convolutional neural network-based discriminator for binary crack segmentation. Shim et al.37 proposed CrackGen, a cGAN that generates synthetic images from semantic masks to enhance crack segmentation systems. However, it is limited by the manual creation of these masks for image generation. In38, Gao et al. introduce a balanced semi-supervised GAN (BSSGAN). The BSS-GAN combines the strengths of semi-supervised learning, which allows the model to learn from both labeled and unlabeled data, and a balanced-batch sampling technique, ensuring that each training batch includes an equal representation of all classes. As a result of this literature review, several gaps emerge. Current generative model-based research has primarily focused on variants of GANs, enhancing segmentation and classification models, neglecting object detection. Classification methods may overlook multiple defects and lose context when applied to cropped patches. Segmentation techniques, while capable of identifying multiple defects, are computationally intensive Scientific Reports | (2024) 14:28904 2 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
and require extensive manual annotation. Binary segmentation, the most explored approach, fails to provide detailed distress class information critical for effective road maintenance strategies. Moreover, non-conditional generative systems dominate, posing challenges due to labor-intensive labeling of synthetic samples limiting their applicability in road maintenance. Additionally, as mentioned earlier, while typical cracks have received significant research attention, less prevalent defects that still cause significant damage remain relatively unexplored. To tackle these challenges, this research introduces a novel attention-guided, class-conditional Generative Adversarial Network named AsphaltGAN. This enhanced generative system incorporates multiple attention mechanisms to synthesize minor defects such as potholes, sealed cracks, diagonal, and irregular cracks from labels (minor distress types). The synthetic images are generated without requiring additional labeling efforts and are utilized to improve an object detection system. The main contributions are as follows: 1. This study designs and optimizes a novel generative model, AsphaltGAN, which is class-conditioned and enhanced with multiple attention mechanisms, capable of generating high-quality images of rare road defects that are underrepresented in the current state-of-the-art. Additionally, this model alleviates the challenges associated with image collection and addresses the costly relabeling issues commonly encountered with synthetic images in existing architectures. 2. AsphaltGAN improves upon state-of-the-art generative models by enhancing visual inspection quality, increasing image quality assessment (IQA) metrics, and strengthening class-conditioning capabilities for generating images of rare road defects. 3. Developed an end-to-end, label-efficient workflow for augmenting object detection datasets, specifically addressing object detection tasks that are less commonly studied compared to classification or segmentation. This approach demonstrates validated improvements in detection efficiency across multiple benchmark datasets.The rest of the paper is organized as follows. “Methods” introduces AsphaltGAN and the improved object detection workflow. “Datasets” briefly presents the benchmark datasets, and “Performance metrics” introduces the used IQA and object detection metrics. “Experimental results and analysis” depicts the main outcomes. The paper is concluded in “Conclusions & future scope”. Methods Attention-guided class-conditional generative adversarial networks The GAN architecture consists of two primary networks: the generator and the discriminator16. The generator, which usually employs a noise vector sampled from a Gaussian distribution, creates synthetic images. The discriminator, acting as a binary classifier, evaluates these synthetic images alongside real ones to determine their authenticity. Both the generator and the discriminator are commonly implemented using convolutional neural networks. Key challenges in training GANs include maintaining stability, preventing mode collapse (which leads to a lack of sample diversity), managing sensitivity to hyperparameters, and addressing issues related to an unconditioned workflow. The proposed generative model will be compared with the following state-of-the-art models: cGAN22, DCGAN17, and WGAN-GP19. cGANs are an advanced form of GANs that incorporate additional information, such as specific types of asphalt distress, into both the generator and discriminator models. This conditional data helps to direct the generation process, thereby eliminating the need to label the generated images. However, while addressing one of the limitations of traditional GANs, cGANs present a new challenge known as label leakage. This occurs when information from the conditioning data unintentionally influences the generated samples, which can result in the model overfitting to the training data or limiting its ability to generalize to new, unseen data. The WGAN is a GAN variant that uses the Wasserstein-1 distance as its loss function, resulting in more stable and efficient training. WGANs converge faster and are less sensitive to hyperparameters, making them easier to train. WGANs do not require careful balancing between the generator and discriminator, nor a meticulous architectural design, and they reduces mode collapse. WGAN employs weight clipping to maintain the Lipschitz constraint in the discriminator, preventing overfitting. In WGAN-GP, weight clipping is replaced by a Gradient Penalty (GP), further enhancing quality and stability. However, these networks lack class-conditioning, necessitating additional annotation after data augmentation. DCGAN is an enhanced version of GAN with specific architectural improvements to address issues like noisy image generation and training instability. Key features of DCGAN include: (a) replacing pooling layers with strided convolutions in the discriminator and fractional-strided convolutions in the generator, (b) applying batch normalization in both the generator and discriminator, (c) eliminating fully connected hidden layers, (d) using Rectified Linear Unit (ReLU) activations in all generator layers except for the output, which uses hyperbolic tangent (Tanh), and (e) employing Leaky ReLU activations in all discriminator layers. DCGAN does not support class-conditioning, so additional labeling is required after data augmentation. The architecture of AsphaltGAN, illustrated in Fig. 1, introduces a novel symmetric design incorporating distinct attention mechanisms and defect-type conditionality. The generator accepts two inputs: fake labels and a noise/latent vector. Fake labels, sampled from a uniform distribution with values between 0 and 3, correspond to four types of minor defects. These labels are converted to dense vectors via an embedding layer and reshaped to the desired size. The noise vector, generated from a Gaussian distribution, is also passed through dense and reshaping layers. Both vectors, dimensions 8 × 8 × 1 for labels and 8 × 8 × 128 for noise, are concatenated into a tensor of 8 × 8 × 129, which then undergoes a self-attention mechanism to preserve feature integrity. The concatenated tensor passes through four identical blocks, each containing a convolutional module and spatial and channel attention mechanisms. Each convolutional module consists of four layers: 2D convolution for feature extraction, batch normalization for stability, Leaky ReLU for non-linearity, and dropout to prevent Scientific Reports | (2024) 14:28904 3 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
overfitting. The final layer uses a similar block with Tanh activation to constrain pixel values within −1 to 1, producing a synthetic image of 128 × 128 × 3. The self-attention mechanism39 processes the concatenated tensor by applying 2D Global Average Pooling (2D-GAP) to flatten it into a vector, capturing channel significance. This vector is transformed through dense, SoftMax, and reshaping layers to generate attention weights, which scale the tensor to enhance important features (Fig.2). Spatial and channel attention mechanisms follow each convolutional module. Self-attention is crucial because it allows the model to weigh different parts of the input tensor, thus helping it focus on the most relevant areas of the image. This leads to better feature learning by promoting long-range dependencies across the input. In AsphaltGAN, it helps refine the features extracted from minor defects, ensuring that subtle and fine details are captured effectively. The spatial attention module uses 2D-GAP, reshaping, dense layers, and sigmoid function to generate weights that highlight significant spatial features. The spatial attention mechanism enhances feature detection by selectively focusing on regions in the image that contain crucial spatial patterns, like the distribution and shape of road defects. This localized feature enhancement improves the model’s capacity to recognize important pavement details, which is critical for generating realistic synthetic frames. The channel attention module applies 2D-GAP, dense layers, and ReLU activation, followed by a sigmoid function to generate weights that emphasize important channels. Channel attention prioritizes the most relevant channels (or feature maps), enabling the model to amplify specific characteristics like texture, depth, or edges, which are essential Fig. 2. Self-attention, spatial, and channel attention mechanisms included in the AsphaltGAN architecture. Fig. 1. Architectural design of AsphaltGAN. The symmetrical model highlights the introduction of conditionality through embedding layers to avoid relabeling synthetic samples, along with the inclusion of selfattention, channel, and spatial attention mechanisms to enhance feature learning and image generation. Scientific Reports | (2024) 14:28904 4 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
in identifying fine-grained distress patterns. By integrating this with spatial attention, AsphaltGAN boosts its ability to enhance both spatial structure and channel-specific features progressively throughout the network. The discriminator has four inputs: real/fake labels and real/fake images. Labels are embedded, passed through a dense layer, and reshaped to 128 × 128 × 1, then concatenated with images into a tensor of 128 × 128 × 4. The discriminator mirrors the generator’s architecture with self-attention and convolutional blocks, but it reduces spatial dimensions and increases color dimensions using transposed convolutions. The output tensor is flattened and passed through a dense layer with dropout, yielding values for each input image. Loss functions Due to the complexity of GAN training, various loss functions will be used to assess the proposed model’s performance (Table 1). Each discriminator’s loss function will include a GP to penalize large gradients, reducing overfitting and promoting stability. The optimal loss function will be selected based on empirical results. The labels yr , yf , yr p , and yf p denote real, fake, predicted real, and predicted fake images, respectively. These labels indicate image authenticity rather than defect classes, with zeros for fake images and ones for real ones. Improved object detection pipeline The objective of this study is to propose an end-to-end methodology to enhance deep learning-based object detection systems for identifying minor pavement defects. This includes addressing issues such as the system’s ability to handle imbalanced defect classes and lower detection rates. Additionally, the process should be fully automated, eliminating the need for human intervention, such as the relabeling of synthetic images, to ensure a truly end-to-end solution for engineering applications. The pipeline of this study, depicted in Fig. 3, involved labeling an asphalt pavement distress image dataset (Mosquitonet42) for enhancing an object detection system. Observations showed that less common defects (potholes, sealed cracks, diagonal cracks, and irregular cracks) had lower detection rates, these defects were cropped and resized to 128x128x3 from the bounding box annotations. The pictures extracted from the dataset exhibit multiple defects of various types per image. Minor defects identified through annotated labels in an object detection framework, were programmatically cropped to produce smaller images containing a single defect instance per image. These images and their labels trained AsphaltGAN to generate synthetic images of minority defects. The synthetic images were resized to match the original dataset dimensions (640 × 640 × 3), with bounding boxes centered and scaled to 90 % of the original size. This process aimed to validate improved detection performance and model robustness across various scales. The object detection system was trained Fig. 3. Improved end-to-end object detection methodology. The diagram highlights two processes: (1) training AsphaltGAN using labeled images with a single defect extracted from multi-defect annotations, and (2) resizing synthetic images from AsphaltGAN and including them in the training set with programmatically generated ground truth for YOLOv8 training. Generator Discriminator BCE-GP BCE( y r ,y r p)+ BCE ( y f ,y f p)+ GP BCE( y r ,y f p) MSE-GP MSE( y r ,y r p)+ MSE ( y f ,y f p)+ GP MSE( y r ,y f p) H-GP H( y r ,y r p)+ H ( y f ,y f p)+ GP H( y r ,y f p) Table 1. Loss functions: binary cross entropy with GP (BCE-GP), mean squared error with GP (MSE-GP), and hinge with GP (H-GP). The analytical expressions are in16,40,41, respectively. Scientific Reports | (2024) 14:28904 5 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
using both original and synthetic images to enhance detection automatically without human involvement, thereby addressing the limitation of needing more image data. Datasets The dataset used to train and validate the various generative models is an open-source image repository called Mosquitonet42. To validate our data augmentation system’s robustness, we selected various public object detection datasets that include minor asphalt pavement defects: Road Damage Dataset 2022 (RDD2022)43, CrackDLHY44, APDD45, and CrackSC28. This approach avoids potential data contamination from Mosquitonet and assesses the generalization of our pre-processing technique. Since not all datasets cover every minority defect, the evaluation will focus on detection performance for the specific augmented defects. Each benchmark dataset will use an 80/20 train/test split, with class distributions shown in Table2. Mosquitonet It is a top-down-view benchmark dataset collected with low-cost vehicle-mounted camera. There are 7099 images of 13 asphalt pavement defects of 640 × 640 × 3, annotated by pavement experts in several object detection formats. For our study, leveraging the annotations (bounding boxes and categories), patches of the minor defects (sealed, diagonal, irregular crack, and pothole) along with the distress type were programmatically extracted, resized to 128 × 128 × 3 (average patch dimensions), and normalized. Thus, a sub-dataset of 1966 instances (local defect images) with 4 classes was constructed, with a train split of 80 % and a 20 % test split. The distribution per distress type is shown in Table 3. RDD2022 RDD2022 comprises 47420 road images with 55000 instances object detection annotations. It contains four road damages: longitudinal, transverse, alligator crack, and pothole. The sub-dataset that most closely approximates the top-down view configuration (selected to prevent network confusion, e.g., diagonal cracks that may appear longitudinal in a wide-view perspective) is China-Motorbike. It was collected with motorbike-mounted smartphone camera moving at an average speed of 30 km/h. This sub-dataset contains 1977 images of 512 × 512 × 3. CrackDLHY CrackDLHY contains a box-based image dataset with four distress types: alligator, sealed, transverse and longitudinal crack. The collection combines manual smart phone photography and vehicle-mounted camera. The frames are captured with different light intensities and shooting angles. The image size is 1280 × 960 × 3. APDD APDD includes 3150 images of 512 × 512 × 3 with alligator, block, longitudinal, diagonal, transverse crack, repair, and pothole. CrackSC CrackSC is annotated for segmentation, but it contains multiple isolated irregular cracks (without defined geometry). Hence, they have been labelled in object detection format. The images were captured using a smartphone on local roads, where heavy shadows and artefacts (e.g., leaves) were present. There are 53 images with dimensions of 320 × 480 × 3. Performance metrics IQA metrics The image quality of the sampled images generated by the proposed generative architectures was assessed both visually and quantitatively using standard IQA metrics. These metrics, including Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index (SSIM), and Fréchet Inception Distance (FID), were used in the optimization of AsphaltGAN and to compare its optimum design with state-of-the-art generative models. Sealed crack Diagonal crack Irregular crack Pothole Train 350 394 232 596 Test 88 98 59 149 Table 3. Distribution of less-represented superficial road defects in the Mosquitonet subdataset. Dataset (defect) RDD2022 (pothole) APDD (diagonal crack) CrackSC (irregular crack) CrackDLHY (sealed crack) Train 188 138 42 400 Test 47 34 11 101 Table 2. Distribution of train/test images by object detection benchmark dataset and minor distress class. Scientific Reports | (2024) 14:28904 6 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
The IQA metrics were computed for both the test set and an equivalent number of images produced by the corresponding generative model. PSNR measures image quality by comparing the maximum possible pixel value to the MSE between the real and the synthetic image. A higher PSNR indicates a better quality. While PSNR is commonly used, it may not fully capture perceptual differences. SSIM evaluates image quality based on luminance, contrast, and structure providing a more perceptual assessment. The closer the SSIM is to one, the better the image quality. FID measures the dissimilarity between feature distributions of real and generated images using a pretrained neural network, with lower FID indicating higher similarity and better quality. The analytical expressions for PSNR, SSIM, and FID are found in46. Object detection metrics To validate object detection model improvements, several metrics are employed. Precision measures the ratio of correctly identified relevant instances to the total predicted positives, reflecting accuracy but potentially missing some true positives. Recall indicates the ratio of correctly identified instances to all actual positives, highlighting the model’s ability to capture relevant instances while risking more false positives. Mean Average Precision (mAP) averages the area under the precision-recall curve across confidence thresholds, with higher scores denoting better performance. mAP50 evaluates at an Intersection over the Union (IoU) threshold of 0.5, while mAP50−95 extends the assessment to IoU thresholds from 0.5 to 0.95, offering insights into performance across various object sizes and poses. The mathematical formulas are detailed in47. Experimental results and analysis In the results section, AsphaltGAN is first analyzed in terms of various loss functions and hyperparameter tuning. The optimal configuration is then compared with state-of-the-art generative models. Finally, results are presented for the object detection models following the application of synthetic data augmentation. For AsphaltGAN, the LeakyReLU activation functions use a value of α=0.2 , and dropout rates of 0.3 and 0.4 are applied in the generator (G) and discriminator (D) layers, respectively. Hyperparameter tuning included sensitivity analysis on the balance between G and D training steps per epoch (k) and learning rate schedules (linear decay, cosine annealing, and constant). The designs of WGAN-GP, DCGAN, and cGAN were based on convolutional layers, aiming to maintain a similar complexity (number of parameters) to AsphaltGAN. Common hyperparameters for all generative models are: learning rates of 1e−4 for both G and D, a batch size of 128, Adam optimizers, a latent dimension of 512, a GP weight of 10, and 3000 training epochs. YOLOv848 was used as the validation model, trained on real and synthetic images. The code is implemented in Python with TensorFlow 2.8.0 for generative models and OpenCV 4.7.0 for image processing. YOLOv8 is implemented in PyTorch 2.0.1. The setup includes a Dell Alienware Aurora R13 with 64 GiB of memory, CUDA 11.4, and an NVIDIA GeForce RTX 3080 Ti GPU, with development conducted in Visual Studio Code. Optimizing AsphaltGAN: loss functions & hyperparameters The analysis starts with BCE-GP (Fig.4), where early training (up to epoch 500) shows a slight rise in both train and test losses due to the model’s adaptation process. Following this, the test loss slightly increases while train loss decreases, indicating that D might be overfitting on known images but performing well on training data. D stabilizes with minor fluctuations around 2.36 ±0.01 (test loss) and 0.70 ±0.02 (train loss) from epoch 2500 onward. Meanwhile, G consistently improves, stabilizing at 1.43 ±0.01 for both losses. The synthetic images generated are realistic and diverse (Fig. 5). In contrast, MSE-GP exhibits a faster learning rate but suffers from artifacts and noise after epoch 2250, leading to instability in loss functions. G’s performance degrades with increased artifacts. Figure 5 shows synthetic images before instability, demonstrating the model’s proficiency in creating diverse and realistic potholes and sealed cracks, though it struggles with granular textures and introduces artifacts in diagonal and irregular cracks. For H-GP, D shows low training loss but high test loss fluctuations, indicating overfitting and poor generalization. G’s loss plateaus, reflecting mode collapse and limited texture diversity. H-GP fails to capture detailed defect features effectively, making it less suitable. W-GP loss faced convergence issues and was thus excluded. IQA metrics (Table 4) further show H-GP’s lower PSNR and SSIM, and higher FID compared to BCE-GP and MSE-GP, confirming the trends observed in loss function dynamics. BCE-GP achieves the best IQA metrics. In GAN training, D is often trained more than G to ensure stability, prevent mode collapse, and improve gradient flow. The following sub-analysis (Fig.6) explores various additional epochs (k) for D in AsphaltGAN, showing that k=5 achieves the best IQA metrics, albeit at the cost of higher computational demand. Lower k values did not consistently improve PSNR, SSIM, or FID, blueindicating that longer training of D is necessary for optimal performance. Monitoring loss functions revealed that for k=1 , both D and G losses stabilized by epoch 2000, whereas for k=3 , instability occurred from epoch 1200 onward. This suggests that higher k values contribute to a more stable convergence but require careful tuning to avoid instability. Additionally, different learning rate (LR) schedules were tested (Fig.6), with linear decay providing the best FID results, while the constant LR produced the highest SSIM. Cosine annealing exhibited instability throughout the training process, especially at later epochs. Thus, the optimal AsphaltGAN configuration is BCE-GP/BCE, k=5 , and a constant LR of 1e−4 , which demonstrated significant improvements in IQA metrics, training stability, and convergence. Figure7 presents synthetic images generated by AsphaltGAN with and without the inclusion of attention mechanisms, illustrating their positive impact as outlined in the previous section. For instances of diagonal and irregular cracks, the addition of attention mechanisms not only yields more precisely defined cracks but also achieves a more granular, textured background that resembles the coarse texture of asphalt pavements due to aggregate presence. In the case of potholes, where the defect occupies a substantial portion of the image, the attention mechanisms enhance edge resolution and create a depth effect by projecting shadows, improving the Scientific Reports | (2024) 14:28904 7 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
realism of the synthetic defects. For sealed cracks, the model without attention mechanisms struggles to generate large-scale sealed cracks, often producing backgrounds with minimal texture and occasionally introducing random artifacts along the edges. However, with attention mechanisms, AsphaltGAN successfully generates extensive sealed cracks, enhances background texture, and even introduces road markings in certain images. Fig. 5. Synthetic minor asphalt road images generated by AsphaltGAN using various loss functions. Fig. 4. Loss functions for the generator and discriminator of AsphaltGAN. Scientific Reports | (2024) 14:28904 8 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/
These attention mechanisms enable AsphaltGAN to progressively refine both spatial and channel-specific features, yielding synthetic images that capture critical pavement details with enhanced realism. Comparison with state-of-the-art generative architectures cGAN and AsphaltGAN exhibit similar loss function curves, demonstrating clear convergence and high learning stability (Fig. 8). WGAN-GP, despite higher oscillations due to its unbounded nature, also shows convergence and stability. In contrast, DCGAN’s loss functions indicate inadequate convergence, with discriminator loss hovering around zero and oscillating significantly, suggesting overfitting and hindering generator performance. Oscillating generator losses reinforce this observation, highlighting the generator’s struggle to deceive the discriminator. DCGAN’s conspicuous oscillations in the FID curves highlight poor convergence, while WGANGP and AsphaltGAN demonstrate smoother FID curves and lower average values, indicating better convergence Fig. 7. Synthetic images generated by AsphaltGAN under optimal settings for each type of minor defect, with and without the inclusion of attention mechanisms, demonstrating the positive impact of attention mechanisms on the results. Fig. 6. (Top) Fine-tuning additional training steps of D in terms of computational cost and IQA metrics. (Bottom) IQA metric curves for different learning rate schedules. PSNR SSIM FID BCE-GP 25.93 ±0.03 0.81 ±0.01 9.58 ±0.04 MSE-GP 21.83 ±0.03 0.56 ±0.02 11.43 ±0.13 H-GP 10.96 ±0.04 0.11 ±0.01 49.02 ±0.48 Table 4. IQA metrics for AsphaltGAN using different loss functions. Scientific Reports | (2024) 14:28904 9 | https://doi.org/10.1038/s41598-024-80199-3 www.nature.com/scientificreports/