## 2 Material and Methods
### Dataset Overview  
The dataset utilized in this study was uniquely collected and curated by the authors, and it has not been employed in any prior research or publicly available repositories. It comprises a total of 6079 high-resolution solar panel images, categorized into three distinct classes based on their condition: broken (2245 images), clean (2130 images), and dirty (1704 images). All images were captured under diverse real-world conditions, including variations in lighting, angles (close-range, long-range, and overhead), and panel orientations, to ensure robustness and generalizability. This research study analyzed an extensive dataset comprising 6079 individual solar panel images, encompassing 2245 images of broken panels, 2130 images of clean panels, and 1704 images of dirty panels. Figure 1 offers a visual illustration of the diverse range of panel images employed in this study. The images were methodically categorized into the following three distinctive groups: broken, clean, and dirty. It is noteworthy that test images were not incorporated during the training phase of any algorithm. All images underwent a resizing process to dimensions of 320 by 320 pixels, while the three aforementioned categories (broken, clean, and dirty) were assigned numerical values of 0, 1, and 2, respectively. Figure 1: Sample images of various panels. To address the class imbalance between the underrepresented broken class and the other classes, data augmentation techniques were applied exclusively to the broken images using a custom Python 3.12 script with the Keras library. Augmentation methods included the following:  
* Rotation (\(\pm\)30\({}^{\circ}\) range);
* Width/height shift (10% of image size);
* Shear (20% distortion);
* Zoom (20% range);
* Horizontal flipping;
* Nearest-pixel fill mode for boundary regions. The application of data enrichment was exclusive to the 'broken' class, given that the initial number of instances of this class (2245) was not significantly imbalanced in comparison to the other classes (\"clean\": 2130, \"dirty\": 1704). However, given the presence of complex and rare defects, such as microcracks and delamination, within the 'broken' class, a targeted augmentation strategy was employed to facilitate the model's learning of these variations. The 'clean' and 'dirty' classes were not augmented due to their adequate representation and reduced variation. The efficacy of these practices is evidenced by the significant enhancement in the performance of the 'broken' class observed upon implementing the boosting strategy. Moreover, despite the absence of any boosting applied to the 'dirty' and 'clean' classes, no statistically significant decline in the accuracy of these classes was observed. This finding further supports the hypothesis that the other classes initially possessed sufficient data and did not require augmentation. The targeted data enrichment strategy applied in this study served to reduce the adverse effects of class imbalance. It resulted in a significant improvement in the model's performance in the 'broken' class. These techniques generated six augmented variants per original broken image, significantly enhancing the dataset's diversity and mitigating overfitting risks. During data splitting for the YOLO-based models, the dataset was partitioned into three subsets:  
* 70% training (4254 images);
* 20% validation (1216 images);
* 10% testing (609 images). Class-specific distributions for YOLO are detailed in Section 3. For the CNN model, a 9-fold cross-validation approach was adopted. The dataset was divided into nine equal folds, with eight folds (\(\approx\)80%) used for training, one fold (\(\approx\)10%) for validation, and the final 10% reserved as an independent test set. This ensured no overlap between the training, validation, and testing phases, preserving the integrity of the evaluation. All images were resized to 320 \(\times\) 320 pixels to standardize input dimensions, and class labels were encoded numerically (0: broken, 1: clean, and 2: dirty).