0% found this document useful (0 votes)
32 views7 pages

6617597

Uploaded by

Jar Jar
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)
32 views7 pages

6617597

Uploaded by

Jar Jar
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
You are on page 1/ 7

Hindawi

International Journal of Photoenergy


Volume 2020, Article ID 6617597, 7 pages
https://doi.org/10.1155/2020/6617597

Research Article
Faults Detection for Photovoltaic Field Based on K-Means, Elbow,
and Average Silhouette Techniques through the Segmentation of a
Thermal Image

Abdelilah Et-taleby , Mohammed Boussetta , and Mohamed Benslimane


Innovative Technologies Laboratory Univérsité Sidi Mohamed Ben Abdellah Fez, Morocco

Correspondence should be addressed to Mohammed Boussetta; [email protected]

Received 29 October 2020; Accepted 21 November 2020; Published 4 December 2020

Academic Editor: Dhruba B. Khadka

Copyright © 2020 Abdelilah Et-taleby et al. This is an open access article distributed under the Creative Commons Attribution
License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is
properly cited.

Clustering or grouping is among the most important image processing methods that aim to split an image into different groups.
Examining the literature, many clustering algorithms have been carried out, where the K-means algorithm is considered among
the simplest and most used to classify an image into many regions. In this context, the main objective of this work is to detect
and locate precisely the damaged area in photovoltaic (PV) fields based on the clustering of a thermal image through the K-
means algorithm. The clustering quality depends on the number of clusters chosen; hence, the elbow, the average silhouette, and
NbClust R package methods are used to find the optimal number K. The simulations carried out show that the use of the K-
means algorithm allows detecting precisely the faults in PV panels. The excellent result is given with three clusters that is
suggested by the elbow method.

1. Introduction trol the renewable energy system over recent years [5–7].
These techniques are based on the use of thermal cameras
Solar energy source is considered one of the most important and drones in order to detect the hottest areas in the PV field,
energy sources, which has attracted considerable attention as shown in Figure 1.
worldwide because it provides clean, reliable, and unlimited In this context, the applications of the machine learning
power. Furthermore, solar energy receives significant invest- algorithms to detect and locate the damaged area precisely
ments to develop and improve the productivity of the solar through the segmentation of a thermal image are
panels, which was evaluated for $131.1 billion in 2019 [1]. investigated.
Solar energy is captured using photovoltaic panels; these Segmentation, clustering, or grouping of data is an unsu-
latter present several faults and anomalies that influence the pervised machine learning technique that aims for the parti-
production of the PV systems. On this way, several tech- tion of data into many groups based on the similarity of
niques have been proposed in many works in the literature properties (e.g., color, size, and shapes). This technique has
to ensure reliable and efficient PV operation; these tech- been widely studied in the literature in a wide range of fields
niques are mainly split into two categories: electrical methods over recent years [8–11]. Therefore, several algorithms have
and nonelectrical methods. been proposed, such as the K-means algorithm (KMA)
Electrical methods are mostly based on I-V characteris- [12], the Fuzzy C Means algorithm (FCM) [13], and the
tics analysis [2], power losses analysis (PLA) [3], statistical Mean Shift algorithm (MSA) [14]. Among them, the K-
and signal processing approaches (SSPA) [4], etc. On the means method is acknowledged as the simplest, fastest, and
other hand, the nonelectrical techniques are based on infra- most popular clustering method. In spite of having these fea-
red thermography, which has known increasing use to con- tures, K-means has a disadvantage related to the number of
2 International Journal of Photoenergy

Drone Data Partitional Hierarchical


Thermal camera
PV field

Figure 2: Type of clustering.

Clustering
Figure 1: Control photovoltaics field using thermal camera on
drone.
Hierarchical Partitional

clusters K that must be optimal to get excellent results. To


address this issue, numerous methods are proposed, such as Agglomerative Divisive K-means Fuzzy c-means
elbow method (EM) [15], average silhouette method (ASM)
Figure 3: Type of FDD.
[16], and gap statistic method (GSM) [17].
In this paper, the k-means algorithm’s application to
detect the damaged solar panels in the PV field is investi- Start
gated. More precisely, the K-means algorithm is employed
to cluster the thermal image into many regions and identify
the damaged area. Furthermore, Elbow and gap methods Number of
are used to select the optimal number of clusters by setting cluster k
the system with various values for K.
The remainder of this work is structured as follows: Sec-
tion 2 provides the clustering techniques and K-means algo- Centroid
rithm. Elbow, average silhouette, and NbClust methods are
explained in Section 3. Simulation results and discussion Calculate objects distance to centroids
are presented in Section 4, whereas Section 5 summarizes
the main conclusions of the present work.
Grouping on minimum distance

2. Clustering Techniques and K-


Means Algorithm Non
No object
move?
2.1. Clustering Techniques. Clustering or grouping is one
of the most interesting parts of unsupervised machine
Yes
learning, which has been extensively employed for image
processing, and has many applications whether image End
retrieval or annotation [18]. This technique aims to classify
data into many regions (clusters) depending on the similarity Figure 4: Flowchart of K-means algorithm.
of characteristics.
As shown in Figure 2, data clustering can be divided into
two types: hierarchical [19, 20] and partitional [21] cluster- the application of the unsupervised machine learning algo-
ing. The partitional clustering is the most straightforward rithm is used to locate the damage in solar panels.
technique for grouping data that provides nonoverlapping
clusters, where each object belongs to one group, whereas
hierarchical clustering permits clusters to have subclusters; 2.2. The K-Means Algorithm. The K-means is the simplest
therefore, each object can belong to many groups. unsupervised machine learning algorithm used for cluster-
Figure 3 exhibits the different algorithms clustering for ing, proposed by Mac Queen in 1967 [23]. This algorithm
each category, where partitional includes, for instance, K- is based on two main steps: the first step is to define the k cen-
mean [12] and fuzzy c-mean [13] algorithms. In contrast, troid, and the second step is to attach each point to the near-
hierarchical clustering is split into two types of algorithms: est cluster. The flowchart diagram of the K-means algorithm
agglomerative algorithms and divisive algorithms [22]. is shown in Figure 4.
Image segmentation is a process of clustering techniques In this paper, the K-means algorithm is used as a cluster-
and the most important key in image processing that aims to ing technique to detect and locate precisely the faults areas in
divide an image into different segments based on their inten- a thermal image of the solar field. Otherwise, the thermal
sity. In this context, this paper focuses on utilizing image pro- image is classified into K groups, and each group contains
cessing to detect the fault in the PV system. In other words, pixels with similar properties (intensity). The K-means
International Journal of Photoenergy 3

Start

Define k from 1 to 10

Calculate the SSE value for each K Calculate the ASO value for each K

Plot the curve of WSS Plot the curve of SW

Locate the bend (knee) in the curve Locate the maximum point of the curve

End

Figure 5: Flowchart of the elbow and the average methods.

3. Optimal Number of Clusters


3.1. Elbow Method. In literature, many research works pro-
posed several methods to determine the optimal number of
clusters K. The elbow method has been considered among
the excellent techniques. It is based on the square distance
between the centroid of the cluster and each cluster’s sample
points. The sum of squared errors (SSE) is the performance
indicator, which is calculated for each value K using the fol-
lowing equation [15]:
Figure 6: Thermal image of PV panels.
k
algorithm procedure to cluster an image includes the follow- SSE = 〠 〠 kX i − Ck k22 , ð3Þ
ing steps, as noted in [24]: k=1 xi ∈Sk
We consider an image with a resolution of ðx, yÞ, p ðx, yÞ
is the input, and Ck be the cluster centers. where x is the data present in each cluster and Ck is the K
th cluster.
Step 1. Initialization of the cluster k and center The optimal value of K is found when the SSE value
drops on the curve drastically and forms a smaller angle.
Step 2. Calculation of the distance d between the center and
each pixel of the image using the following equation: 3.2. Average Silhouette Method. The average silhouette
method has the same purpose as the elbow method that
d = kpðx, yÞ − C k k ð1Þ was proposed by Liu and Sarkar [25]. It is based on comput-
ing the average silhouette of observations for different values
Step 3. Attach all pixels to the nearest center using the calcu- of k. Otherwise, the difference between distances an object
lated distance has to other objects in the same cluster and the distance it
has to other objects in other clusters. For object i in a cluster
Step 4. Calculation of the new center position using the fol- C i , the silhouette width (SW) is defined using the following
lowing equation: equation [16]:

1 bi − ai
Ck = 〠 〠 pðx, yÞ ð2Þ Si = , ð4Þ
k y∈C x∈C max ðai , bi Þ
k k

Step 5. Repeat steps 2, 3, and 4 until the center Ck no longer where bi = min ð∑ j dði, jÞ/jC j jÞ, C i ≠ C j and ai = min ð∑ j d
moves. ði, jÞ/jCi jÞ, Ci = C j .
The SW is considered as a performance indicator varying
Step 6. Reconstruction of the image by reshaping the pixels of from -1 to +1, where the optimal number of clusters is corre-
the cluster. sponding to the highest value.
4 International Journal of Photoenergy

3 - channel matrix Reshaped image vector


Original image 100 123 147

43 67 96 78 43 100
78 96 115
96 67 123
96 122 143



113 145 172

Figure 7: Converting Image to Vector.

1e9 The elbow method showing the optimal k The silhouette method showing the optimal k
2.00
0.7
1.75
0.6
1.50

Average silhouette
0.5
1.25
Inertia

0.4
1.00

0.75 0.3

0.50 0.2

0.25 0.1

0.00 0.00
2 4 6 8 10 2 4 6 8 10
Number of clusters k Number of clusters k

Figure 8: Optimal number of clusters suggested by the elbow and the average silhouette methods.

Optimal number of clusters - k = 3


5
4. Results and Discussion
Frequency among all indices

4 In this section, we are going to present the results obtained


using the K-means algorithm to detect and locate the faults
3
in PV panels. Firstly, before applying this algorithm, the opti-
2
mal number of clusters K has to be defined; hence, the Elbow
and the average silhouette methods are used.
1 All implementations are carried out on the thermal image
presented in Figure 6; after getting permission from the
0 online website [27], the simulation was performed using
0 1 10 2 3 4 5 6 7 NA’s
python 3.7.0 and an i5 8th gen 1.8 GHz machine with 8 GB
Number of clusters k
RAM platform (Windows10 64 bit).
Figure 9: Optimal number of clusters using NbClust R package. Before implementing the methods, the image must be
converted to vector in the 3-D space of RGB; hence, the input
The flowchart diagram of the elbow method and the aver- image is converted from RGB (red, green, and blue) colors
age silhouette method are illustrated in Figure 5. space to HSV (hue, saturation, and value). Therefore, the
LxHx3 image is transformed into a Kx3 matrix with
K = LxH, as shown in Figure 7.
3.3. NbClust Package. To ensure the clustering quality, it is The results of applying the Elbow and the average silhou-
crucial to select the best number of clusters suggested by ette methods are presented in Figure 8. For the elbow
the most methods cited in the literature. Hence, NbClust method, it is clear that the elbow point occurs at K = 3; hence,
has been developed for this purpose, which is a function of it is the optimal value suggested. On the other side, according
the NbClust R package [26] that allows selecting the optimal to the curve of silhouette width, the highest value corre-
number of clusters in a dataset by varying all combinations of sponding to K = 2, which is the optimal number of clusters
the number of clusters, distance measures, and clustering proposed by the average silhouette method.
methods. In other words, NbClust is based on thirteen indi- In addition, the NbClust function [28] was also used to
ces, as presented in [26], and it provides the indices number find the optimal number of clusters based on 26 indexes, as
suggesting for each number of clusters. The optimal number shown in Figure 9. According to the majority rule, the best
will be chosen according to the majority rule. number of clusters is 3.
International Journal of Photoenergy 5

Segment 1 Segment 2

Figure 10: Output results using K-means algorithm for k = 2.

Segment 1 Segment 2 Segment 3

Figure 11: Output results using K-means algorithm for k = 3.


Thermal image
Faults detected

Figure 12: The application results of the K-means algorithm.

Figures 10 and 11 present the outputs results of applying sents excellent results that allow to detect and identify the
the K-means algorithm on a thermal image of solar panels, damaged areas that are presented in segment 3. Hence, the
using the optimal values of clusters suggested, respectively, elbow method has given the most optimal number of clusters
by the Elbow and the average silhouette methods. than the average silhouette method.
The output results are fragmented into segments depend- Four results were carried out in Figure 12 in order to val-
ing on the number of clusters. It is evident that Figure 11 pre- idate the effectiveness of the K-means algorithm for detecting
6 International Journal of Photoenergy

the faults in PV panels. As can be noticed from this table, the of the article by all the team, M. Bousseta submitted the arti-
K-means algorithm has successively detected all faults pre- cle to the journal. All authors of this research paper have
sented in the four thermal images of PV panels. directly participated in the planning, execution, or analysis
Finally, the K-means algorithm with the optimal number of this study. All authors read and approved the final
of clusters has demonstrated the excellent performance that manuscript.
can be integrated to the drone and the thermal system to
identify precisely the damaged solar panels in the PV field.
References
5. Conclusion [1] T. Ajadi, V. Cuming, R. Boyle et al., Global Trends in Renew-
able Energy Investment 2020, 2020.
The energy demand has increased quite fast, which requires [2] A. Mellit, G. M. Tina, and S. A. Kalogirou, “Fault detection and
the improvement of all energy sources. Especially, solar diagnosis methods for photovoltaic systems: a review,” Renew-
energy providing clean, reliable, and unlimited energy. able and Sustainable Energy Reviews, vol. 91, pp. 1–17, 2018.
Accordingly, many works have been studied to diagnose [3] J. Solórzano and M. A. Egido, “Automatic fault diagnosis in
and control the production of PV panels, among them, the PV systems with distributed MPPT,” Energy Conversion and
thermal drone system, which allows controlling the vast Management, vol. 76, pp. 925–934, 2013.
farms of PV panels. [4] F. Harrou, Y. Sun, B. Taghezouit, A. Saidi, and M.-E. Hamlati,
In this paper, the application of the K-means algorithm “Reliable fault detection and diagnosis of photovoltaic systems
is investigated to cluster a thermal image of PV panels and based on statistical monitoring approaches,” Renewable
automatically detect the damaged areas. The quality of Energy, vol. 116, pp. 22–37, 2018.
clustering depends on selecting an optimal number of clus- [5] B. Du, Y. He, Y. He, and C. Zhang, “Progress and trends in
ters; hence, the elbow and the average silhouette methods fault diagnosis for renewable and sustainable energy system
were used. based on infrared thermography: a review,” Infrared Physics
The K-means algorithm and elbow method together pro- & Technology, vol. 109, p. 103383, 2020.
vide excellent results to find and detect precisely the faulty [6] Z. A. Jaffery and A. Haque, “Temperature measurement of
panels. Therefore, this algorithm can be integrated into the solar module in outdoor operating conditions using thermal
thermal drone system to find the faults in the PV system eas- imaging,” Infrared Physics & Technology, vol. 92, pp. 134–
ily and in real-time, especially for large PV fields. 138, 2018.
[7] M. Cubukcu and A. Akanalci, “Real-time inspection and
determination methods of faults on photovoltaic power sys-
Abbreviations tems by thermal imaging in Turkey,” Renewable Energy,
ASM: Average silhouette method vol. 147, pp. 1231–1238, 2020.
EM: Elbow method [8] A. Khan, Z. ur Rehman, M. A. Jaffar et al., “Color image seg-
FCM: Fuzzy C means algorithm mentation using genetic algorithm with aggregation-based
clustering validity index (CVI),” Signal, Image and Video Pro-
GSM: Gap statistic method
cessing, vol. 13, no. 5, pp. 833–841, 2019.
HSV: Hue, saturation, and value
[9] M. Ali, M. Khan, and N. T. Tung, “Segmentation of dental X-
KMA: K-means algorithm ray images in medical imaging using neutrosophic orthogonal
MSA: Mean shift algorithm matrices,” Expert Systems with Applications, vol. 91, pp. 434–
SSE: Sum of squared errors 441, 2018.
SSPA: Statistical and signal processing approaches [10] T. Ren, H. Wang, H. Feng, C. Xu, G. Liu, and P. Ding, “Study
SW: Silhouette width on the improved fuzzy clustering algorithm and its application
PLA: Power losses analysis in brain image segmentation,” Applied Soft Computing, vol. 81,
PV: Photovoltaic p. 105503, 2019.
RGB: Red, green, and blue. [11] X. Ji, J. F. Henriques, and A. Vedaldi, “Invariant information
clustering for unsupervised image classification and segmenta-
Data Availability tion,” in Proceedings of the IEEE/CVF International Conference
on Computer Vision (ICCV), pp. 9865–9874, Seoul, Korea
The data used to support the findings of this study have not (South), 2019.
been made available because it is confidential. [12] D. Li, S. Wang, N. Gao, Q. He, and Y. Yang, “Cutting the
Unnecessary Long Tail: Cost-Effective Big Data Clustering in
Conflicts of Interest the Cloud,” IEEE Transactions on Cloud Computing, p. 1,
2019.
The authors declare that they have no competing interests. [13] J. C. Bezdek, Fuzzy Mathematics in Pattern Classification, [Ph.
D. thesis], Applied Mathematics, Cornell University, 1973.
Authors’ Contributions [14] K. Wisaeng and W. Sa-Ngiamvibool, “Exudates detection
using morphology mean shift algorithm in retinal images,”
A. Et-taleby carried out the simulations. The results were dis- IEEE Access., vol. 7, pp. 11946–11958, 2019.
cussed and evaluated by M. Boussetta and M. Benslimane. A. [15] M. A. Syakur, B. K. Khotimah, E. M. S. Rochman, and B. D.
Et-taleby wrote the first version of the paper, M. Boussetta Satoto, “Integration K-Means Clustering Method and Elbow
corrected and modified it afterwards, and after supervision Method for Identification of the Best Customer Profile
International Journal of Photoenergy 7

Cluster,” in IOP Conference Series: Materials Science and Engi-


neering, p. 12017, Surabaya, Indonesia, 2018, IOP Publishing.
[16] H. Yahyaoui and H. S. Own, “Unsupervised clustering of ser-
vice performance behaviors,” Information Sciences, vol. 422,
pp. 558–571, 2018.
[17] R. Tibshirani, G. Walther, and T. Hastie, “Estimating the num-
ber of clusters in a data set via the gap statistic,” Journal of the
Royal Statistical Society, Series B: Statistical Methodology,
vol. 63, no. 2, pp. 411–423, 2001.
[18] Y. Ren, N. Wang, M. Li, and Z. Xu, “Deep density-based image
clustering,” Knowledge-Based Systems, vol. 197, p. 105841,
2020.
[19] K. Li, Z. Ma, D. Robinson, and J. Ma, “Identification of typical
building daily electricity usage profiles using Gaussian mixture
model-based clustering and hierarchical clustering,” Applied
Energy, vol. 231, pp. 331–342, 2018.
[20] C. Li, J. Bai, Z. Wenjun, and Y. Xihao, “Community detection
using hierarchical clustering based on edge-weighted similar-
ity in cloud environment,” Information Processing and Man-
agement, vol. 56, no. 1, pp. 91–109, 2019.
[21] S. Ben Salem, S. Naouali, and Z. Chtourou, “A fast and effective
partitional clustering algorithm for large categorical datasets
using a k-means based approach,” Computers and Electrical
Engineering, vol. 68, pp. 463–483, 2018.
[22] P. Govender and V. Sivakumar, “Application of k-means and
hierarchical clustering techniques for analysis of air pollution:
a review (1980–2019),” Atmospheric Pollution Research,
vol. 11, no. 1, pp. 40–56, 2020.
[23] J. MacQueen, “Some Methods for Classification and Analysis
of Multivariate Observations,” Proc. Fifth Berkeley Symp.
Math. Stat. Probab, 1967, pp. 281–297, Oakland, CA, USA,
1967.
[24] N. Dhanachandra, K. Manglem, and Y. J. Chanu, “Image seg-
mentation using K-means clustering algorithm and subtractive
clustering algorithm,” Procedia Computer Science, vol. 54,
pp. 764–771, 2015.
[25] Z. Liu and S. Sarkar, “Simplest representation yet for gait rec-
ognition: Averaged silhouette,” in Proceedings of the 17th
International Conference on Pattern Recognition, 2004. ICPR
2004., pp. 211–214, Cambridge, UK, 2004, IEEE.
[26] C. Malika, N. Ghazzali, V. Boiteau, and A. Niknafs, “NbClust:
an R package for determining the relevant number of clusters
in a data set,” Journal of Statistical Software, vol. 61, pp. 1–
36, 2014.
[27] “Infrared solar panels,” May 2020, https://thermodrone-
inspection.com/panneaux-solaires-et-fermes-solaires/.
[28] M. Charrad, N. Ghazzali, V. Boiteau, A. Niknafs, and M. M.
Charrad, “NbClust: An R Package for Determining the Rele-
vant Number of Clusters in a Data Set,” Journal of Statistical
Software, vol. 61, pp. 1–36, 2014.

You might also like