# Defect R-CNN: A Novel High-Precision Method for CT Image Defect Detection
## 3 Experimental Data and Parameters
### Evaluation Metrics  
To evaluate model performance, several metrics are employed to assess defect detection accuracy, including recall, precision, intersection over union (IoU), mean average precision (mAP), and frames per second (FPS). Recall measures the proportion of correctly detected defects out of all actual defects, while precision calculates the proportion of correct detections among all predictions. IoU assesses the overlap between predicted and ground truth segmentations, with higher values indicating better accuracy. Average Precision (AP), derived from the precision-recall (PR) curve, reflects the average precision for a single class, while mAP represents the mean of AP across all classes, providing an overall model performance. FPS measures the number of images processed by the model per frame, serving as a key indicator of the model's inference speed.  
The specific formulas for these metrics are as follows:  
\[Recall=\frac{TP}{FN+TP} \tag{11}\]  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Parameters**} & \multicolumn{3}{c}{**Training Dataset**} & \multicolumn{3}{c}{**Test Dataset**} \\ \cline{2-6}  & **Actual** & **Synthetic Data** & **Total** & **Actual** & **Test** & **Total** \\  & **Component** & **Made by DSM** & **Component** & **Component** & **Component** & **Total** \\ \hline Number of images & 500 & 1500 & 2000 & 100 & 750 & 850 \\ Image resolution & 1536 \(\times\) 1536 & 1536 \(\times\) 1536 & 1536 \(\times\) 1536 & 1536 \(\times\) 1536 & 1360 \(\times\) 760 & — \\ Number of hole defect & 205 & 6729 & 6934 & 104 & 36383 & 36487 \\ Number of loose defect & 113 & 2201 & 2314 & 48 & — & 48 \\ Number of side defect & 615 & 992 & 1607 & 184 & — & 184 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Parameters of the dataset.  
Figure 8: Test graphite components.  
\[Precision=\frac{TP}{FP+TP} \tag{12}\]  
\[AP=\int_{0}^{1}precision(recall)d(recall) \tag{13}\]  
\[mAP=(\frac{1}{k})\sum_{i=0}^{k}(AP)i \tag{14}\]  
\[IoU=\frac{TP}{TP+FP+FN} \tag{15}\]  
\[FPS=\frac{1}{Average\ Time\ per\ Frame} \tag{16}\]  
where \(TP\) (True Positive) refers to the probability that a defect is predicted to exist and the actual result is defective; \(TN\) (True Negative) refers to the probability that no defect is predicted and the actual result is defect-free; \(FP\) (False Positive) refers to the probability that a defect is predicted but the actual result is defect-free; and \(FN\) (False Negative) refers to the probability that no defect is predicted but the actual result is defective. \(k\) represents the total number of object classes.  
According to the specific requirements of this study, the mAP is further categorized into mAP-bbox and mAP-segm, corresponding to bounding box detection and segmentation mask evaluation, respectively. Given the small size of the defects under investigation, even minor pixel-level deviations can lead to significant fluctuations in the IoU value. Therefore, an IoU threshold of 0.50 is adopted to determine true positives when computing AP. In this work, performance is evaluated per defect category, including hole, loose, and side defects. For example, AP-bbox-50-hole and AP-segm-50-hole represent the average precision for bounding box detection and segmentation mask, respectively, of hole-type defects under an IoU threshold of 0.5. The same naming convention applies to the other defect categories. In addition, a larger area under the PR curve typically indicates better overall detection performance. A smoother PR curve suggests greater consistency in distinguishing between positive and negative samples across different thresholds. Such smoothness reflects a model's robustness in balancing precision and recall, and its ability to generalize well across diverse defect types.