# An Overview of CNN-Based Image Analysis in Solar Cells, Photovoltaic Modules, and Power Plants
## 2 Imaging Methods and CNN Processing
### CNNs
The following metrics--accuracy, precision, recall, F1-score--play a key role in evaluating the performance of classification models, especially when the dataset is not perfectly balanced (e.g., rare errors vs. frequent goodness) [44; 73; 77; 78; 80; 81; 82; 83; 84; 85; 86]. Accuracy shows and calculates the rate of correct forecasts (true positive and true negative) in relation to every prediction. This is a good overall measure, but not enough if the data are unbalanced. The calculation of accuracy is shown in Equation (1) [78]:  
\[Accuracy=\frac{TP+TN}{TP+FP+TN+FN} \tag{1}\]  
Recall (or Sensitivity) quantifies the proportion of actual positive cases that were correctly identified. This is important, because it helps in the avoidance of overlooked mistakes. Equation (2) shows how to obtain the Recall value [78]:  
\[Recall=\frac{TP}{TP+FN} \tag{2}\]Precision indicates the relative amount of forecast positive cases to true positives. It is useful when false alarms (false positives) are costly (e.g., scrapping intact cells marked as false). Precision can be calculated from Formula (3) [78]:  
\[Precision=\frac{TP}{TP+FP} \tag{3}\]  
The F1-Score shows the harmonic mean of the previously calculated precision and recall values, therefore balancing out its constituents. It is useful when having to decide what is more important: false alarms or missed errors. The F1-Score can be determined following Formula (4) [78]:  
\[F1-score=2.\frac{Precision\cdot Recall}{Precision+Recall}, \tag{4}\]  
where  
TP--True Positive means cases correctly identified as positive. FP--False Positive means cases incorrectly identified as positive. TN--True Negative represents cases correctly identified as negative. FN--False Negative represents cases incorrectly identified as negative. Intersection over Union (IoU) and Mean Average Precision (mAP) are key metrics in the evaluation of object detection and segmentation. IoU measures the ratio of overlap between estimated and actual marker boxes or masks, which is critical for localization accuracy. The mAP is the average of the mean accuracies calculated for different classes, taking into account the quality of detection at multiple IoU thresholds. These metrics are essential to quantitatively compare the performance of models such as YOLO, Faster R-CNN, Mask R-CNN, or U-Net. The calculation of the IoU is as follows [77]:  
\[IoU=\frac{A_{pred}\ \cap\ A_{gt}}{A_{pred}\ \cup\ A_{gt}}, \tag{5}\]  
where  
\(A_{pred}\): the predicted (estimated) area;  
\(A_{gt}\): the ground truth (real) area. The calculation of the mAP is as follows [73]:  
\[mAP=\frac{1}{N}\sum_{i=1}^{N}AP_{i}, \tag{6}\]  
where  
\(N\): the number of classes;  
\(AP_{i}\): the average precision of the \(i\)-th class. CNNs require significant computational power to learn, especially for large image datasets. Although small models can be run on CPU and integrated GPU alone, the use of an external, more powerful GPU is highly recommended to drastically reduce the learning time. NVIDIA RTX 3060/3070 are recommended for development and medium-sized projects, and RTX 3090 or A100 for advanced use. These GPUs are mentioned because the latest developments in these cases are focused on AI, especially in the 50 series. On the CPU side, at least Intel i7 or AMD Ryzen 7 with 16-32 GB RAM is recommended. There are also cloud-based alternatives (e.g., Google Colab Pro, AWS, Azure) which are also ideal for scalable resources [87]. There are several powerful environments for the development of CNNs. Among the most popular are TensorFlow v2.18 and Keras v3.0, which offer a high-level API for rapid prototyping. PyTorch v2.4 is popular in research with its more dynamic, flexible code structure. Python v3.11, the language on which they are based, is easy to learn at a beginner level, while offering the potential for intermediate to advanced deep learning applications. Google Colab v3.8 provides a cloud-based option for GPU-supported learning, while Jupyter Notebook v7.2 is excellent for interactive coding.