## 3 Results
### YOLOv9  
YOLOv9 is an advanced object detection model that builds upon the strengths of its predecessor, YOLOv8, while introducing key optimizations for enhanced accuracy and robustness. The model utilizes a more efficient backbone, often integrating features from  
Figure 12: YOLOv8-m model results. Scaled-YOLOv4 and transformer-based architectures to improve feature extraction. The neck incorporates an upgraded FPN+PAN structure, enabling better multi-scale feature fusion for effectively detecting small and large objects. A notable distinction of YOLOv9 is its incorporation of an adaptive spatial feature selection mechanism, a feature absent in YOLOv8. This mechanism serves to reduce redundant computations, thereby enhancing detection reliability. Furthermore, the model has been endowed with advanced anchor-free strategies and gradient-guided optimizations, contributing to object classification and localization refinement. The aforementioned enhancements collectively render YOLOv9 particularly effective in scenarios requiring high precision, such as detecting defects in solar panels under varying environmental conditions. In the YOLOv9 framework, five distinct model weight configurations are utilized, namely tiny, small, medium, compact, and extended, representing progressively increasing model complexities. The tiny model corresponds to the most miniature architecture, followed by the small model, which balances computational efficiency and accuracy. The medium model is an intermediate option, while the compact and extended models provide enhanced feature extraction capabilities with increasing parameter complexity. All five weight configurations were employed during the training and testing phases to ensure a comprehensive evaluation of model performance. Regardless of the model size, the training process was conducted for 100 epochs, ensuring sufficient iterations for optimizing the learning process while maintaining consistency across different weight configurations. Transfer learning was not employed in training the YOLO model; instead, the model was trained from scratch. The model parameters are initialized with random weights during training to learn unique features specific to the data. It has been demonstrated that training from scratch is advantageous in two particular cases. Firstly, in the event of the target dataset containing features significantly different from those of the pre-trained datasets. Secondly, if the training dataset is sufficiently comprehensive in size, in this case, since extraneous and irrelevant features do not constrain the model's parameters, it develops a more optimal representation capability specific to the target dataset. Consequently, the model demonstrates superior data-specific performance without being influenced by the potential bias introduced by general pre-training. Given the considerable magnitude of the dataset, the optimal approach would be to initiate training from the outset instead of employing the transfer learning strategy. YOLOv8 and YOLOv9 parameters are as follows: epochs: 100, batch: 16, imgsz: 320, device: auto, workers: 8, optimizer: SGD, lr0: 0.01, lrf: 0.01, momentum: 0.937, weight_decay: 0.0005, warmup_epochs: 3.0, warmup_momentum: 0.8, warmup_bias_lr: 0.1, box: 7.5, cls: 0.5, dfl: 1.5, hsv_h: 0.015, hsv_s: 0.7, hsv_v: 0.4, degrees: 0.0, translate: 0.1, scale: 0.5, flipud: 0.0, fliplr: 0.5, mosaic: 1.0, mixup: 0.0, and copy_paste: 0.0. The data presented in Table 4 indicate that the extended model weight achieves the highest precision-recall and F1-score compared to the other model weights, demonstrating superior overall performance. As shown in Figure 13, the F1-score curve reaches its maximum value of 0.92 at a specific threshold of 0.435, highlighting the optimal balance between precision and recall for this model configuration. In addition, Figure 14 show the confusion matrix of YOLOv8-e. In the YOLOv9-s model, the sensitivity, specificity, and accuracy values derived from the confusion matrix are 1.00, 0.9307, and 0.9518, respectively.