# A Dataset of Pulsed Thermography for Automated Defect Depth Estimation
## 6 Discussion  
This study introduced a PT dataset comprising both defect location and depth labeling information, establishing a valuable resource for comparing different automated defect characterization methods. Initially, a conventional manual labeling method was applied to identify defect locations. Furthermore, considering the availability of 3D CAD files for each specimen, a CAD-based labeling approach was proposed to enhance the labeling accuracy and provide additional defect depth information.  
The labeling results were evaluated through two methods: qualitative evaluation for the visual comparison of label masks and quantitative evaluation using a reference distance to calculate the regions. Qualitative evaluation revealed that the manual labeling method was accurate for defects in rectangular shapes. However, it may introduce bias in labeling round defects. In contrast, the quantitative evaluation demonstrated that the 3D CAD-based approach excelled in accurately determining the size of defect regions.  
\begin{table}
\begin{tabular}{|c|c|c|c|} \hline
**Defect Depth** & **Precision** & **Recall** & **mAP50** \\ \hline All & 0.403 & 0.557 & 0.478 \\ \hline
0.5 cm & 0.336 & 0.778 & 0.516 \\ \hline
1.0 cm & 0.347 & 0.467 & 0.487 \\ \hline
1.5 cm & 0.292 & 0.462 & 0.442 \\ \hline
2.0 cm & 0.248 & 0.3 & 0.206 \\ \hline
2.5 cm & 0.791 & 0.778 & 0.736 \\ \hline \end{tabular}
\end{table}
Table 4: Results on validation dataset of PCT data.  
\begin{table}
\begin{tabular}{|c|c|c|c|} \hline
**Defect Depth** & **Precision** & **Recall** & **mAP50** \\ \hline All & 0.798 & 0.742 & 0.811 \\ \hline
0.5 cm & 0.648 & 0.889 & 0.887 \\ \hline
1.0 cm & 0.671 & 0.8 & 0.844 \\ \hline
1.5 cm & 0.81 & 0.846 & 0.807 \\ \hline
2.0 cm & 1 & 0.507 & 0.836 \\ \hline
2.5 cm & 0.863 & 0.667 & 0.681 \\ \hline \end{tabular}
\end{table}
Table 3: Results on validation dataset of PPT data.  
Figure 10: Confusion matrix of the results on the datasets preprocessed through TSR, PPT, and PCT.  
\begin{table}
\begin{tabular}{|c|c|c|c|} \hline
**Defect Depth** & **Precision** & **Recall** & **mAP50** \\ \hline All & 0.423 & 0.561 & 0.577 \\ \hline
0.5 cm & 0.625 & 0.889 & 0.802 \\ \hline
1.0 cm & 0.584 & 0.8 & 0.801 \\ \hline
1.5 cm & 0.403 & 0.573 & 0.654 \\ \hline
2.0 cm & 0.184 & 0.1 & 0.16 \\ \hline
2.5 cm & 0.319 & 0.444 & 0.47 \\ \hline \end{tabular}
\end{table}
Table 5: Results on validation dataset of TSR data.  
For automated defect depth and location prediction, YOLOv5 object-detection algorithm was applied to datasets preprocessed using the PPT, PCT, and TSR methods. The dataset that generated by PPT method enabled the model to attain an mAP of 0.811 across all depth classes, likely due to the rich temporal information in the phase images, which was more effective than the other preprocessing methods in emphasizing temporal details.  
The YOLOv5 model, being lightweight, is well-suited for industrial applications. In contrast to one-dimensional thermal-profile-based defect depth estimation approaches, the proposed method leverages spatial-temporal information from thermal datasets to concurrently determine defect location and size, yielding higher accuracy in depth estimation. Nevertheless, this study is not without limitations. The YOLOv5 model provides only classification results, which are discrete values. Exploring a regression model capable of predicting continuous values could be particularly interesting for estimating defect depth, especially in scenarios where the depth of defects is uncertain.