# A Rapid Bridge Crack Detection Method Based on Deep Learning
## 3 Results  
### The Training Process and Results of DCGAN  
The experimental environment is presented in Table 3. The training process of the neural network involves 2000 epochs. A batch size of 64 is used, and the weight parameters of both the discriminator and generator are automatically saved every 50 epochs. The loss function adopts the binary cross entropy, which can be expressed by Equation (9) [38]. The loss curves of the generator and discriminator are presented in Figure 4. The training process is mainly divided into two phases (an unstable phase and a stable phase). The loss values fluctuate greatly in the unstable phase, and the loss curves convergence gradually. Real-time visualization allows for visual inspection of the samples. As shown in Figure 5, the training results of four representative epochs are selected. In the early phase of training (approximately 0-1200 epochs), the generated cracks have obvious defects, and the morphology of the cracks is only slightly learned by the neural network. In approximately 1200-1600 epochs, the morphology of the cracks gradually appears, but the generated results are still unstable. The quality of the produced cracks notably improves as the training progresses into its later stages.  
\[\text{Loss}=-\frac{1}{N}\underset{i=1}{\overset{N}{\sum}}y_{i}\cdot\log{\hat{y }_{i}}+(1-y_{i})\cdot\log(1-\hat{y}_{i}) \tag{9}\]  
Figure 3: The architecture of YOLOv5.  
Figure 4: The loss curves of the DCGAN: (**a**) The generator loss curve of the training process; (**b**) The discriminator loss curve of the training process.  
Figure 5: The partial real-time visualization.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Name** & **Parameter** \\ \hline System & Windows 10 \\ CPU & Inter Core i7-11800H CPU @ 2.3 GHz \\ Memory & 8 GB \\ Graphics card & NIVIDA Gerroce RTX3060 \\ Environment & Python 3.6, Tensorflow 2.8.0, Keras 2.8.0, Numpy 1.22.2 \\ Configuration & CUDA 11.2 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Parameters of the computer environment.  
In this equation, \(N\) is the output size of the predicted results of neural network, \(y_{i}\) is the true value of the \(i\) label, and \(\hat{y_{i}}\) is the predicted value of the \(i\) label.  
For computational efficiency, the best training results are chosen from the images generated at the 1950 th training epoch. The current weight parameters are saved for future use in generating bridge cracks efficiently. Under our computer hardware conditions, the time cost of generating 1000 artificial crack samples is on the order of 10 s. Figure 6 shows part of original crack images and generated crack images. The diversity in shapes of the generated cracks is evident, including vertical cracks, cross cracks, horizontal cracks, and X-type cracks, which are consistent with the real dataset. From a subjective perspective, the bridge cracks produced by the trained DCGAN effectively encapsulate the primary features of the original cracks. It can be challenging to differentiate the generated samples from the original cracks. Finally, 90 generated bridge cracks are used as the dataset in the following experiments and analysis.