0% found this document useful (0 votes)
9 views5 pages

PV Cell Fault Detection with YOLOv8 & PSO

This paper introduces a novel fault detection method for photovoltaic (PV) cells that combines YOLOv8 with Particle Swarm Optimization (PSO) to enhance detection accuracy. The proposed model achieves a mean Average Precision (mAP) of 94% at an IoU threshold of 0.5, outperforming existing methods and demonstrating its effectiveness in early fault diagnosis. The study highlights the potential of AI-driven approaches in improving the reliability and efficiency of PV systems.

Uploaded by

Tech Studio
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

PV Cell Fault Detection with YOLOv8 & PSO

This paper introduces a novel fault detection method for photovoltaic (PV) cells that combines YOLOv8 with Particle Swarm Optimization (PSO) to enhance detection accuracy. The proposed model achieves a mean Average Precision (mAP) of 94% at an IoU threshold of 0.5, outperforming existing methods and demonstrating its effectiveness in early fault diagnosis. The study highlights the potential of AI-driven approaches in improving the reliability and efficiency of PV systems.

Uploaded by

Tech Studio
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A Novel Approach for PV Cell Fault Detection

using YOLOv8 and Particle Swarm Optimization


Quoc Bao Phan and Tuy Tan Nguyen
School of Informatics, Computing, and Cyber Systems
Northern Arizona University
Flagstaff, AZ 86011, USA
[Link]@[Link]

Abstract—This paper presents a novel approach for detecting methods have been utilized in other studies, such as Gao et
faults in photovoltaic (PV) cells. The proposed method combines al. [8] and Al et al. [9], while others rely on image capture
the power of You Only Look Once version 8 (YOLOv8) and methods using solar panels that have been in operation for
Particle Swarm Optimization (PSO) architecture. Unlike exist-
ing methods, the proposed model leverages PSO to optimize some time. These methods have been significantly effective
the parameters of YOLOv8, enhancing detection accuracy. To and innovative, as they can diagnose faults in solar panels
evaluate the efficacy of the proposed approach, two experimental early, even before the problem has a significant impact on the
cases are conducted, one with a 70% training set and the other energy system. This can help operators to have maintenance
with an 80% training set. The PV system data is used as input and repair plans in place in advance, rather than dealing with
for the model, and YOLOv8 is utilized to extract necessary
features before detecting fault cells from the data. We use PSO the unwanted consequences of failures. Furthermore, You Only
algorithm to optimize the model’s parameters to achieve the best Look Once (YOLO) version 5, as demonstrated in [10]–[12]
detection accuracy. The experimental results demonstrate that the or other variants, has shown impressive capabilities in object
proposed approach achieves the highest mean Average Precision recognition tasks.
(mAP) of 94% at an intersection over union (IoU) threshold of In this study, we focus on developing a fault detection model
0.5, outperforming existing fault detection methods in terms of
accuracy and robustness. Moreover, by leveraging the power of based on actual images using the latest version of YOLO,
YOLOv8 and PSO, the approach offers a promising solution for YOLOv8, which was developed in early 2023. Additionally,
reliable and efficient fault detection in PV systems, thus making the Particle Swarm Optimization (PSO) algorithm is used to
it a practical solution to enhance the system’s performance and find the optimal parameters for the recognition model. The
reduce maintenance expenses. data set includes over 2,000 images of solar panel cells with
Index Terms—PV cell fault detection, deep neural network,
YOLOv8, optimization
corresponding labels, divided into training and testing sets for
the model’s input.
The remaining of this paper is structured as follows. Section
I. I NTRODUCTION
II introduces the system implementation. Data collection and
The detection of defects in solar panels is an important preparation are described in Section III. Section IV presents
and evolving issue, particularly with the increasing adoption experimental results, followed by the conclusions in Section
of renewable energy. Conventional fault detection methods V.
typically rely on data analysis, I–V curve analysis, and thermal
II. S YSTEM I MPLEMENTATION
chart simulations, as described in [1]–[4]. However, these
methods can be challenging to implement as they require A. Particle Swarm Optimization
a certain level of expertise to analyze and diagnose errors. PSO is a popular metaheuristic optimization technique that
Moreover, these faults are frequently only discovered after simulates the behavior of a swarm of particles moving in a
the solar panel has encountered an issue, resulting in energy search space to find an optimal solution to a given problem.
loss or even damage to distribution circuits. Consequently, PSO was first proposed by Kennedy and Eberhart in 1995 [13],
these methods are associated with technical and maintenance [14] and since then, it has become one of the most widely used
challenges. optimization algorithms in various fields, including engineer-
To address these challenges, researchers have been ex- ing, finance, biology, and many more.
ploring the use of machine learning algorithms to automate The basic principle of PSO is inspired by the social behavior
the detection of defects in solar panels and improve the of animals, specifically the flocking and swarming behavior
reliability and efficiency of photovoltaic (PV) systems. The of birds and fish. Each particle in the swarm represents
studies of Kabir et al. [5] utilized tree-based models, while a potential solution to the problem, and its movement is
An et al. [6] employed statistical models, and Yi et al. [7] influenced by its own experience as well as the experience
used Support Vector Machines (SVM) for fault classification of its neighbors. The particles in the swarm move around the
and identification. However, the accuracy of these methods search space in search of the optimal solution by adjusting
has not been optimal. On the other hand, deep learning their positions and velocities according to certain mathematical
Fig. 1. Structure of YOLOv8 model.

formulas. Additionally, PSO can also handle both continuous network (CSPNet) architecture to reduce the computa-
and discrete optimization problems, which makes it a versatile tional cost of the network while maintaining its accuracy.
optimization algorithm. • Neck: The neck is a network that connects the backbone
This study utilized PSO to optimize the learning rate, batch to the detection head. In YOLOv8, the neck is a spatial
size, anchor box size, and input image size of the YOLO model pyramid pooling (SPP) module, which uses different
to maximize the mean average precision at an intersection over pooling sizes to capture features at different scales.
a union (IoU) threshold of 0.5. • Detection head: The detection head predicts the bounding
boxes and class probabilities for each object in the input
B. Objective Detection Model image. In YOLOv8, the detection head consists of several
YOLO is a state-of-the-art object detection algorithm that convolutional layers, followed by a set of anchor boxes
was first introduced in [15], which uses a deep neural network that predict the bounding boxes and class probabilities
to detect and localize objects in an image. The objective of for each object.
YOLO is to predict bounding boxes and class probabilities • Loss function: The loss function in YOLOv8 combines
for each object in the input image. YOLO has demonstrated several terms, including the objectness loss, the clas-
its high performance in object detection and localization on sification loss, and the bounding box regression loss.
various datasets. The YOLO algorithm has also been extended The objectness loss penalizes incorrect predictions of
to real-time object detection applications, making it a popular objectness, which indicates whether an object is present
choice for object detection in video streams and robotics in a particular location.
applications. • Post-processing: After the detection head has predicted
The YOLOv8 architecture can be shown in Fig. 1 and bro- the bounding boxes and class probabilities, YOLOv8
ken down into several main components, which are described applies non-maximum suppression to remove redundant
as follows: bounding boxes and select the most probable ones. It also
• Backbone network: The backbone network is responsible uses anchor boxes to refine the predicted bounding boxes
for extracting features from the input image. In YOLOv8, and improve the accuracy of the final detections.
the backbone network is based on the cross-stage partial

Fig. 2. The original image of PV cells.


III. DATA C OLLECTION AND P REPARATION TABLE I
H YPERPARAMETER T UNING
The data set used in this study consists of 2,624 gray-
scale images of solar cells, each with dimensions of 300×300 Learning Batch Anchor box Input
Test Case
pixels, collected by Buerhop-Lutz, [Link] [16]. The images rate size size size
depict functional and defective solar cells with varying degrees Ratio of YOLOv7 0.001 16 64 640
of degradation, extracted from 44 different solar modules. The
0.7 YOLOv8 0.0001 32 128 1280
data set was collected using electroluminescence (EL) imag-
ing, a non-invasive technique for visualizing the performance Ratio of YOLOv7 0.0001 32 64 640
of solar cells. EL imaging provides a high-contrast image of 0.8 YOLOv8 0.0001 32 128 1280
the solar cell, revealing any defects that may be present. The
images in the data set were annotated to identify the location
and type of defects present in the solar cells. The defects were average precision of the model at an IoU threshold of 0.5. We
categorized as intrinsic or extrinsic, depending on whether they also evaluate the model performance using other metrics, such
originated from within the solar cell material or from external as F1 score, Precision-Recall curve, and mAP@50-95.
factors such as handling or installation. In a confusion matrix, the rows represent the true classes of
To ensure consistency in the data set, all images were the objects, and the columns represent the predicted classes.
normalized with respect to size and perspective. This involved Since the background class refers to all the pixels in the
scaling and cropping the images to ensure they were of the image that are not part of any object, it is not a class that
same size and orientation. Additionally, any distortion induced the YOLO model is trained to detect. Therefore, when the
by the camera lens used to capture the EL images was elim- model is applied to an image, it should not predict any objects
inated prior to solar cell extraction. This was achieved using belonging to the background class. As a result, in Fig.3, the
standard image processing techniques, including geometric confusion matrix of the YOLO models will always be 0 in
correction and image enhancement. The overview of the input the background-background column because it is not a valid
data set is shown in Fig. 2. prediction for the model to make.
The optimized results for each case are presented in Table I.
IV. E XPERIMENTAL R ESULTS Fig. 4 shows the F1 and precision-recall curves for the case of
A. Training Phase a training ratio of 0.8, demonstrating the impressive training
ability of the YOLOv8 model. With epoch = 100, the loss
In this study, we aim to compare the performance of the functions and training results are summarized in Fig. 5. As the
latest YOLO object detection model versions, YOLOv7 and loss parameters tend to converge toward their minimum values,
YOLOv8, and investigate the impact of different training ratios the precision, recall, as well as the mAP@50, and mAP@50-
on the model performance. YOLOv7 and YOLOv8 introduce 95 scores all tend to increase with the number of epochs.
several improvements over the previous versions, such as
a more powerful backbone network, improved anchor box B. Object Detection Results
design, and better feature fusion. The results of the error detection are shown in Fig. 6, where
To evaluate the performance of the two models, we di- most of the errors were detected with a model confidence level
vide the data set into training, validation, and testing sets, set at 0.7. However, as the input images were in black and
with training ratios of 70% and 80% for both YOLOv7 white, this may have had some impact on the detection ability.
and YOLOv8. The model parameters, including learning rate, Additionally, a comparison between the two YOLO models is
batch size, anchor box size, and input size, are optimized using presented in Table II. The observations of Table II and Fig. 6
the PSO method. can be listed as follows:
In our PSO implementation, the maximum number of itera- • Both YOLO models offer good error detection capabili-
tions (max inter) is set to 50, and the optimization function is ties, with mAP@50 and mAP@50-95 scores above 70%
to maximize mAP@50, where mAP@50 measures the mean in all cases.

Fig. 3. The confusion matrix of 0.7 (left) and 0.8 (right) ratio. Fig. 4. F1 and PR curve with training ratio of 0.8 of YOLOv8 model.
Fig. 5. The loss function and metrics (100 epochs) of YOLOv8 model.

Fig. 6. The detection result of YOLOv8 with 0.8 training ratio.

TABLE II The models demonstrate high accuracy in PV fault detec-


P ERFORMANCE C OMPARISON OF D IFFERENT YOLO M ODELS tion, making it a promising approach to detecting PV faults
before they have a negative impact on the PV system.
mAP mAP
Test Case Precision Recall F1
@50 @50-95
Ratio of YOLOv7 0.77 0.73 0.75 0.75 0.72
V. C ONCLUSION
0.7 YOLOv8 0.85 0.81 0.83 0.80 0.76
In conclusion, the use of AI in PV cell fault detection has
Ratio of YOLOv7 0.83 0.82 0.82 0.88 0.81 been gaining increasing attention in recent years. This study
0.8 YOLOv8 0.94 0.91 0.92 0.94 0.93 contributes to this field by providing a comparison between the
two latest YOLO models combined with the PSO algorithm.
The results of the study indicate that both models perform
• For this specific problem, the 80% training set ratio well in terms of mAP scores, with YOLOv8 demonstrating
performs better than the 70% ratio, possibly due to the a significant improvement in several metrics. These findings
presence of difficult-to-detect objects in the data set, highlight the potential of YOLOv8 for accurate and efficient
requiring more training data. PV cell fault detection based on images. These findings can
• The YOLOv8 model outperforms YOLOv7, with serve as a valuable reference for researchers and practitioners
mAP@50 scores of 80% versus 75% for the 70% training in this field and further improvements in the future.
ratio case, and 94% versus 88% for the 80% training ratio
case as well. ACKNOWLEDGMENT
• However, there are still some limitations as the detection
accuracy is not yet perfect and there is still room for This work was supported by Northern Arizona University,
improvement in the future. USA.
R EFERENCES
[1] V. F. Pires, D. Foito, and T. G. Amaral, “Fault detection and diagnosis in
a PV grid-connected T-type three level inverter,” in 2015 International
Conference on Renewable Energy Research and Applications (ICRERA),
2015, pp. 933–937.
[2] S. Roy, M. K. Alam, F. Khan, J. Johnson, and J. Flicker, “An irradiance-
independent, robust ground-fault detection scheme for PV arrays based
on spread spectrum time-domain reflectometry (SSTDR),” IEEE Trans-
actions on Power Electronics, vol. 33, no. 8, pp. 7046–7057, 2018.
[3] K. Kasar and P. C. Tapre, “A new fast detection module for short-
circuit current detection in PV grid system,” in 2018 2nd International
Conference on Inventive Systems and Control (ICISC), 2018, pp. 468–
472.
[4] H. Iles and Y. Mahmoud, “Power based fault detection method for
PV arrays,” in IECON 2021 – 47th Annual Conference of the IEEE
Industrial Electronics Society, 2021, pp. 1–6.
[5] S. Kabir, A. Shufian, and M. S. R. Zishan, “Isolation forest based
anomaly detection and fault localization for solar PV system,” in
2023 3rd International Conference on Robotics, Electrical and Signal
Processing Techniques (ICREST), 2023, pp. 341–345.
[6] T. Andrianajaina, E. J. R. Sambatra, C. Bernard Andrianirina,
T. David Razafimahefa, and N. Heraud, “PV fault detection using the
least squares method,” in 2016 International Conference and Exposition
on Electrical and Power Engineering (EPE), 2016, pp. 846–851.
[7] Z. Yi and A. H. Etemadi, “A novel detection algorithm for line-to-
line faults in photovoltaic (PV) arrays based on support vector machine
(SVM),” in 2016 IEEE Power and Energy Society General Meeting
(PESGM), 2016, pp. 1–4.
[8] W. Gao, “PV array fault detection based on deep neural network,” in
2021 IEEE Green Technologies Conference (GreenTech), 2021, pp. 42–
47.
[9] A. A. Al-katheri, E. A. Al-Ammar, M. Alotaibi, and G. A. Ghazi,
“Artificial neural network application for faults detection in PV systems,”
in 2022 IEEE Delhi Section Conference (DELCON), 2022, pp. 1–6.
[10] O. Nacir, M. Amna, W. Imen, and B. Hamdi, “YOLO V5 for traffic
sign recognition and detection using transfer learning,” in 2022 IEEE
International Conference on Electrical Sciences and Technologies in
Maghreb (CISTEM), vol. 4, 2022, pp. 1–4.
[11] L. Sun and L. Wang, “An improved YOLO V5-based algorithm of safety
helmet wearing detection,” in 2022 34th Chinese Control and Decision
Conference (CCDC), 2022, pp. 2030–2035.
[12] Y. Xiao, A. Chang, Y. Wang, Y. Huang, J. Yu, and L. Huo, “Real-time
object detection for substation security early-warning with deep neural
network based on YOLO V5,” in 2022 IEEE IAS Global Conference on
Emerging Technologies (GlobConET), 2022, pp. 45–50.
[13] J. Kennedy and R. Eberhart, “Particle Swarm Optimization,” in Pro-
ceedings of ICNN’95 - International Conference on Neural Networks,
vol. 4, 1995, pp. 1942–1948 vol.4.
[14] Y. Shi and R. Eberhart, “A modified Particle Swarm Optimizer,” in
1998 IEEE International Conference on Evolutionary Computation
Proceedings. IEEE World Congress on Computational Intelligence (Cat.
No.98TH8360), 1998, pp. 69–73.
[15] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look
once: Unified, real-time object detection,” in 2016 IEEE Conference on
Computer Vision and Pattern Recognition (CVPR), 2016, pp. 779–788.
[16] C. Buerhop-Lutz, S. Deitsch, A. Maier, F. Gallwitz, S. Berger, B. Doll,
J. Hauch, C. Camus, and C. J. Brabec, “A benchmark for visual
identification of defective solar cells in electroluminescence imagery,”
in European PV Solar Energy Conference and Exhibition (EU PVSEC),
2018.

You might also like