# Lem-Detector: An Efficient Detector for Photovoltaic Panel Defect Detection
## 4 Experiments
### Evaluation Metrics  
In region-level defect detection tasks, an objective evaluation of model performance requires considering both classification and localization accuracy. Typically, Precision, Recall, and mean Average Precision (mAP) are employed to assess the accuracy of object detection. mAP represents the mean across all categories, while Precision is defined as the proportion of true defect samples among all detected defect samples. Recall, on the other hand, indicates the proportion of true defect samples among all actual defect samples. The formulas for each metric are provided as Equations (13)-(16):  
\[Precision=\frac{TP}{TP+FP} \tag{13}\]  
\[Recall=\frac{TP}{TP+FN} \tag{14}\]  
\[AP=\int_{0}^{1}PdR \tag{15}\]  
\[mAP=\frac{\sum_{i=1}^{N}\text{AP}_{i}}{N} \tag{16}\]  
Additionally, Frames Per Second (FPS), Giga Floating-point Operations Per Second (GFLOPS), and the number of parameters are utilized to evaluate the overall performance of  
\begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline  & **Ck** & **Fr** & **Bc** & **Tl** & **Sc** & **Hd** & **Vd** & **St** \\ \hline Training & 876 & 2041 & 731 & 695 & 95 & 555 & 97 & 350 \\ Testing & 384 & 917 & 297 & 286 & 40 & 243 & 40 & 142 \\ Total & 1260 & 2958 & 1028 & 981 & 135 & 795 & 137 & 492 \\ \hline \hline \end{tabular} Note: Crack (Ck), Finger (Fr), Black core (Bc), Thick line (Tl), Star crack (Sc), Horizontal dislocation (Hd), Vertical dislocation (Vd), and Short circuit (St).  
\end{table}
Table 1: Number and distribution of defect instances.  
the model, where \(TP\), \(FP\), and \(FN\) represent the number of correctly identified targets (true positives), the number of incorrectly identified targets (false positives), and the number of actual targets that were not detected (false negatives), respectively. Average Precision (\(AP\)) refers to the mean precision of the detection algorithm at different recall levels. The P-R curve is typically used for this calculation, where \(S_{P\text{-}R}\) denotes the area enclosed by the P-R curve and the axes. The computation method is illustrated by Equation (17), as shown below:  
\[AP=S_{P\text{-}R} \tag{17}\]  
In addition, we introduce the TIDE [37] metric as an additional means of analyzing model performance. In object detection, the primary metric used to assess performance is the mean Average Precision (mAP). However, since a false positive (\(FP\)) can arise from various issues such as duplicate detection, misclassification, incorrect localization, confusion with the background, or a combination of these factors, it is not straightforward to analyze detection errors solely through mAP. Similarly, a false negative (\(FN\)) may represent a completely missed ground truth (GT), or a potentially correct prediction that is merely misclassified or mislocalized. These error types can significantly impact mAP in different ways. Therefore, we utilize the TIDE evaluation metric to provide insight into our model's superior performance. TIDE categorizes error types into six categories: classification errors (Cls), localization errors (Loc), both classification and localization errors (Both), duplicate detection errors (Dupe), background errors (Bkg), and missed GT errors (Miss), along with the counts of FPs and FNs.