# Thermal Image and Inverter Data Analysis for Fault Detection and Diagnosis of PV Systems
## 3 Method and Analysis
### Processing Historical Inverter Data  
Within this section, we have undertaken a mathematical examination of both hotspot faults and bypass diode failures using the current and voltage measurements obtained from the inverters of Site-1. For this purpose, four different machine learning methods, namely Neural Network, Random Forest, kNN, and Gradient Boosting, were used. According to thesis study of [PERSON] and [PERSON] [40], the simulation results show deviation from measurements of 2% in summer and 25% in winter conditions. The reasons for the higher inaccuracy in the wintertime are lower production, higher uncertainty in the albedo values, and more diffuse irradiation. In this study, data from the March-August period collected for 3 years were used. Thus, the effect of seasonal deviations was minimally reflected in the dataset. The dataset consists of instantaneous data obtained from Site-1 and there are also missing data and extraordinary instantaneous data. Therefore, the dataset was revised, and missing and meaningless data lines were excluded. As is known, bypass diodes are wired within the PV module and provide an alternate current when a cell or panel becomes shaded or faulty. They are used to enhance the output power production during partial shading conditions and to protect partially shaded \begin{table}
\begin{tabular}{l l c} \hline \hline  & \multicolumn{2}{c}{**Distance Metric**} \\ \hline
**Type** & **Description** & **Number of Clusters** \\ \hline Cosine & Cosine distance & 14 \\ Euclidean & Square root of summed difference between values & 12 \\ Manhattan & Sum of difference between values & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hierarchical cluster numbers under different distance metrics. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline \multirow{2}{*}{**Distance Metric**} & \multicolumn{2}{c}{**Bypass Diode Failure**} & \multicolumn{2}{c}{**Hotspot Faults**} & \multicolumn{2}{c}{**No-Fault Panels**} \\ \cline{2-7}  & **Actual** & **Predicted** & **Actual** & **Predicted** & **Actual** & **Predicted** \\ \hline Cosine & 127 & 123 & 38 & 38 & 250 & 249 \\ Euclidean & 127 & 121 & 38 & 38 & 250 & 249 \\ Manhattan & 127 & 119 & 38 & 38 & 250 & 247 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Hierarchical clustering results of Site-1 with the different distance metrics. PV cells from fully operating cells in full sun within the same solar panel when used in high-voltage series arrays. The three inputs, percentage of voltage drop, percentage of open-circuit voltage, and percentage of short-circuit current, employed by [PERSON] et al. (2018) to investigate bypass diode failure, were also incorporated into this study. On the other hand, hotspot faults events have a percentage of 50% compared to all fault events in the PV modules, according to [PERSON] et al. (2018). Hotspots in solar panels refer to localized areas on the panel experiencing elevated temperatures compared to the surrounding regions. While they are frequently encountered, predicting their occurrence poses a considerable challenge. Cell temperatures within these hotspots can often soar to 150 degrees Celsius, resulting in permanent and irreversible damage. For this reason, we used the temperature values of the panels as input parameters in this study. Current and voltage (I-V) values obtaining from the inverters of Site-1 were utilized to create training and testing datasets including two fault types (hotspot faults and bypass diode failures) and a normal operation. The dataset consists of real-time data between March and August of the last three years, including 2021-2023. The reason for choosing the data covering the period in question is that Site-1 receives more sunlight in this period of the year due to its location. The random sampling method was applied to test the fault detection ability of the algorithms employed and to measure the unbiased estimate of our proposed models.