Fast Partial Shading Detection on PV Modules for Precise Power Loss Ratio Estimation Using Digital Image Processing

,


Introduction
Te solar PV energy system's constant development and cost-reduction benefts have brought it into a popular renewable energy solution for large-scale implementation or small-scale distributed generation (DG) [1].In 2022, the increased capacity of solar PV accounts for 220 GW, which is more than half of the total increase in renewable energy, namely, 340 GW.Tis growth is attributed by market-driven procurement and corporate power purchase agreements [2], thus indicating the pivotal element of solar PV technology in the industrial sector's efort to shift towards a sustainable energy system by implementing the solar PV roof-top for which its load profle matches with solar cycle and has adequate infrastructure for installation [3].
Typically, PV modules are designed with a life span of about 25 years and can be reduced due to external factors, such as weather conditions' efects [4].Moreover, controlling the power generated by PV systems is impossible because it relies on the irradiance and ambient temperature within the installed PV location [5].Tis gives rise to what is termed "PV mismatch," signifying the diference between the expected output power of a PV module and its actual performance [6], can occur.
Bressan et al. [7] and Femia et al. [8] have highlighted that the primary cause of PV mismatch, which signifcantly afects power production, is partial shading.It refers to a situation where specifc areas of a solar panel are cast in shadows or there are objects falling on the surface of PV such as uneven dust or soiling [9,10].When shading afects a greater number of individual cells and occurs unevenly, a higher proportion of cells will operate in a state of reverse direction, resulting in the generation of signifcant but dispersed heat energy in abnormally high temperature [11].Te continued exposure to these elevated temperatures accelerates the degradation of the material used to encapsulate PV modules at a faster pace, which in turn limits the amount of radiation that the cells can receive.Tis phenomenon is commonly referred to as "hot spots" and potentially leading to irreversible damage to the cells [12].A potential approach for addressing this issue entails the incorporation of bypass diodes between the modules.However, it is important to keep in mind that while this solution is advantageous, it does not efectively resolve the underlying issue [13].
Moreover, when photovoltaic (PV) modules reach the end of their operational lifespan or sufer damage, they transform into environmentally hazardous waste.Tis phenomenon can be attributed to the presence of heavy metals, such as lead (Pb), tin (Sn), and silicon (Si), within the PV module materials.Tese heavy metals possess the potential to leach into the soil or groundwater, leading to pollution and posing health hazards when ingested by humans [14].
Terefore, maintaining the condition and the maximum performance of PV module has emerged as a signifcant challenge for solar power plants in the present era.While regular maintenance is essential, conducting manual inspections can be impractical and resource-intensive, particularly for large-scale systems [15].Tis necessitates the development of automated techniques for fast identifcation of partial shading to prevent hot spot occurrence.
Tere are already several developments in PV inspection methods to analyze the condition of PV modules.Tose are visual image inspection [16], infrared thermography (IRT) [17], photoluminescence [18], electroluminescence [19], and IV characteristic measurements [20].Among those, IRT inspections appear to be more suitable to provide appealing fault diagnosis of PV modules.Tis is due to the fact that thermal imaging is a fast method which requires minimal instrumentation and works without disrupting the operation of the PV system in the feld [21,22].Accordingly, this paper aims to detect partial shading faults using IRT methodologies to prevent performance degradation of PV modules where surveillance is difcult or time-consuming and analyze its power output reductions caused by the faults using the pixel area of the detected hot spot and panel to simplify maintenance work.
In recent years, some studies have reported their literature on PV plant inspection using IRT.Te detection is carried out after images are captured by a thermal camera or UAV and then are processed in computer software.Te reviews, listed in Table 1, cover several insights regarding several algorithms used such as digital image processing (DIP) [23][24][25][26][27][28][29][30], deep learning (DL) [31], and other machine learning (ML) techniques [26,32], which have comparable results to detect modules with or without faults and classify it into a category.Despite that, those approaches were able to detect the module's fault but do not address its correlation to the module itself.
In our proposed method, a fast partial shading detection application was developed to accurately detect parts of the PV module undergoing potential hot spot situations.Te detected PV module's pixel area allows us to formulate a power loss ratio to predict its power output reduction that has been evaluated by measurement experiment.Our novelty and main contributions to this paper are as follows: (1) A fast partial shading detection on the PV module based on an adaptive thresholding and modifed noise fltering approach is proposed to enable fast and accurate detection.Te method uses a combination of thermal and visual images captured by IRT to detect the potential hot spots situations.(2) A power loss ratio formula is developed, which serves as a methodology for quantifying the reduction in power output from the pixel density of the detected partial shaded area and PV module.(3) Te validation and evaluation of the proposed detection method and formula are conducted through a benchmarking process against the manual inspection method, known as the current-voltage (IV) characteristic curve inspection method.
Te paper is structured as follows.In Section 1, the objective and related studies are introduced.Section 2 delves into the confguration and algorithm used in the research, providing a detailed explanation of the methodology used to detect partial shading faults.Section 3 discusses the experiment result obtained from the study, which is the detection in thermal images and IV curve validation, followed by concluding remarks in Section 4.

Experimental Setup
Te collection of thermal and visual image data was conducted within the context of a laboratory-scale PV power plant simulation.Tis simulation replicates an of-grid solar PV system, which is frequently deployed in remote areas depicted in Figure 1.Two modules were utilized to simulate distinct conditions: one module operated under normal conditions, while the other was subjected to partial shading which shows a potential hot spot situation.Te black tape was employed to obstruct sunlight from reaching the solar cells, thereby inducing partial shading and simulating a hot spot scenario.Te frst hot spot, marked as light red, has an area of 100 × 50 mm, while the second hot spot, marked as red, has an area of 152.4 × 152.4 mm.Furthermore, the PV module is connected to a load as a 500 W lamp to form a closed circuit so that current fows and a hot spot arises.All data regarding the module operation such as irradiance, temperature, current, and voltage are captured using measurement tools.Te PV module used in this experiment is Bifacial JSKY 260, and its technical specifcation is stated in Table 2.
When the PV module is operating, visual and thermal imagery is taken using an unmanned aerial vehicle (UAV) simulated using a Flir E8XT camera with adjustable height and distance, as pictured in Figure 2. Te image was captured multiple times over several days under varying conditions to obtain the test data.Ten, the image is entered into the application for hot spot detection and module segmentation.

2
Journal of Electrical and Computer Engineering  Te IV curve and irradiation are measured using the Seaward Solar Survey 200R and PV200, which can be connected wirelessly with the help of a connection from Seaward Solarlink to compare the output parameters between standard solar modules and hot-spotted modules.Te measurement follows a topology such as in Figure 3. Furthermore, the data retrieval process and tools that were used are shown in Figure 4.
Tese data are processed using software from each device.SolarCert and SolarDataLogger, Seaward's built-in software, are used to process irradiation, IV curve, and ambient temperature data.FLIR TOOLS, the built-in software of FLIR E8-XT, is used to process thermal image data and visible light imagery.Finally, temperature data from the thermocouple thermometer sensor are processed using Excel.So, images were obtained with the radiation data of 360 W/m 2 to 919 W/m 2 , which can represent the PV installation environment.

Image Processing Method to Detect Defective PV Module
Image processing techniques use segmentation and extract most objects' feature and accurately detect object with less computational resources [33].Although deep learning has been the state-of-the-art method to detect objects in an image or video due to better accuracy and probability score result [34], it can only be useful with a sufcient training dataset refecting large diversity of target conditions, since decreasing the number of data used will increase its detection error [35].On-device AI tasks using machine learning also show prominent energy drain for drones and mobile systems in general [36].Tus, for faulty PV modules, where data are still new and scarce, image processing is still the efective technique to achieve our objective.
Our proposed method uses adaptive thresholding and modifed noise fltering approach as a template for the image to detect objects.Figure 5 shows the main steps of the proposed algorithm.Partially shaded PV module images are captured using the infrared camera and RGB camera as shown in Figure 6.Ten, hot spot features are extracted on the thermal images to detect occurring hot spots in the  Ten, a morphological transformation is carried out to maintain or reduce the basic shape of the solar modules from the thresholding results.After that, a noise flter is designed to ensure cell-level hot spots on the PV module are detected.In contrast, tiny hot spots are fltered out due to inaccuracies in the camera's temperature measurement.Lastly, the defect ratio is calculated by dividing the total hot spot area by the total module area.Te fnal image will combine all contours detected, the area information of the hot spot and module, and the defect ratio.

Hot Spot Segmentation.
Te thermal image is frst converted to grayscale for hot spot segmentation to speed up the image process time and smoothed using Gaussian blur.Ten, the image's average value and standard deviation are calculated based on the histogram in Figure 7. Kim et al. [24] use criterion for mean intensities (CMIs) and criterion for standard deviations (CSDs) with one standard deviation range to be classifed as a defective panel thus lacking adaptability on new images.
Terefore, the threshold limit in the binary thresholding function can be calculated by using ( 1) and (2).So, the system will be adaptive; that is, the user does not need to calibrate each diferent image.

Module Segmentation.
For module segmentation, the visual image is converted into an HSV colour space rather than using the average luminance that Aghaei et al.
[37] used.Tis method enables us to separate the background and the modules using the binary thresholding much more easily, and it can be controlled using software [28].Te next stage is implementing module edge detection with canny edge detection which Xie et al. used [29].Tis only produces little noise, unlike other methods, such as Sobel edge detection [38] and Laplacian edge detection [39], as shown in Figure 8.While line detection in each module is performed using the Hough line transform by    Gao et al. [23], it can only obtain the largest and longest continuous line on the image and cannot obtain more detailed lines [29].Also, for a large-scale PV plant, it would not be efective for the visualization itself as the line would not be seen in higher altitude.Ten, morphological transformations, such as dilation, opening, and closing, are performed to maintain the basic shape of the PV module.After obtaining the intact solar module image, module detection uses contours to determine the bounding box with a contour value greater than the module flter threshold value.

Noise Filtering.
Te flter design is carried out to obtain the threshold value of cell and module detection so that the system can distinguish real hot spots from tiny hot spots with similar characteristics.Using the previously established image capture method, the distance between the FLIR E8-XT camera and the center point of the PV module are measured using the Pythagoras theorem.Te Flir E8-XT camera has a vertical and horizontal feld of view (FOV) of 45 °and 34 °with a resolution of 320 × 240 pixels.Taking these values into account, we can calculate the width of the projection image obtained with the following equation: Te horizontal width and vertical width values of the image projection are divided by the resolution of the camera to get the pixel density of the image for the x and y axis of the module which is explained in the following equations: where ppi is pixel per inch and its units are pixel/mm to simplify the calculation.We also calculate the flter needed to diferentiate between possible error in thermal camera and real shade.Ten, if we multiply it by the pixel density value of the image, we will obtain the value of the number of pixels for each cell and each module contained in the image which is stated in the following equation: Noise Filter (cell|module) � pixel (cell|module) * m%, (7) where m is flter threshold value to eliminate the noises.Tis m value will be tested from 0 to 100% to produce the most optimal flter noise value.

Power Loss Ratio.
After hot spot and module segmentation is carried out, the contour area of the detected objects that is found is used to calculate PV defect ratio.Defect ratio is a measurement of how large is the hot spot area with respect to the total PV module area.Typically, this process involves calculating the ratio between PV power output under optimal conditions and when defects occur, which is carried out through IV curve measurements.Te reduction in the IV curve, when several cells are shaded, corresponds to the activation of multiple bypass diodes, resulting in several steps in the IV curve, as demonstrated in Dolara et al. [20].To obtain similar results using digital image processing, the power loss ratio can be computed by dividing the cumulative pixel area of detected hot spots by the total pixel area of PV modules identifed through contour-based segmentation, as demonstrated in (8) by Dhimish et al. [40].Furthermore, by using the defect ratio, we can formulate the power loss ratio since the increase in hot-spotted solar cells would reduce the total power.Te PV module power reduction with its standard condition due to partial shading can be stated as follows: where R is the number of bypass diode in the module and B is the bypass diode that is activated during the defected condition.Tis estimation method will be tested with the IV curve test calculation to assist maintenance activities.

Results and Discussion
In this research, the detection algorithm is tested using 38 images collected for three days.Te captured image is shown in Figure 9, which has two PV modules and is conditioned with two hot spots.Te frst hot spot, pointed at Sp1, has a temperature of 69.5 °C.Te second hot spot, pointed at Sp2, has a temperature of 64.7 °C.Also, the cell's temperature pointed at Sp3 that operate normally is 59.3 °C.Tese points show the distinct operation temperature between cells experiencing partial shading, which may become potential hot spots if prolonged exposure continues.Tese images are analyzed using the program designed to test the capability and accuracy of the program's detection.After that, a comparative analysis was carried out using the IV curve inspection method to validate the power loss ratio calculation.

Hot Spot and PV Module Detection.
Before hot spot detection was executed, a threshold variation test was carried out for hot spot and module segmentation.To perform hot spot segmentation using (1), we conducted a variation test with n values ranging from 0 to 2 during the thresholding process.Te most optimal n value, which efectively detected hot spots in the image while minimizing noise, was determined to be n � 1.7, as illustrated in Figure 10.
For the module segmentation using HSV colour conversion, a lower and upper HSV value variation test was conducted and acquired for lower HSV [110, 0, 0] and upper HSV [255, 255, 255] displayed in Figure 11.Ten,  masking is implemented to fnd the module's edge or contour of the module.
Subsequently, a noise fltering process was implemented to reduce errors in hot spot detection arising from noise interference.Extensive testing involved varying the m% parameter for both pixel cells and modules in accordance with ( 6) and (7). Figure 12 illustrates the outcomes before and after noise fltering, highlighting that a cell flter threshold of 45% and a module flter threshold of 75% were chosen due to their ability to achieve the most optimal detection results.
Te fnal result can be seen in Figure 13, showing the original images, hot spot segmentation, module segmentation, and the resulting image.Te fnal image also calculates the area of the detected PV module and hot spots in pixels, calculates its defect ratio, and measures the height and width of the panel.Te testing is conducted by analyzing the image one by one.
Tests are analyzed based on the program's ability to detect hot spots or PV modules.Figure 14(a) shows that hot spot one was detected 38 times out of 38 images taken with an average of 868 pixels; however, in Figure 14(b), hot spot     two was detected 34 times out of 38 images taken with an average of 168 pixels.Tis occurs because the second hot spot is smaller in size compared to the frst one.Due to various conditions, the adaptive thresholding process identifes the second hot spot as a very small pixel area, leading the system to categorize it as noise and subsequently ignore it.Meanwhile, based on Figure 15, for module detection, it successfully detected all 76 modules of all 38 images with an average of 15,672 pixels.From all the detection results, a calculation of the accuracy is carried out to evaluate the algorithm performance.Te accuracy is defned as follows: where the true positive (TP) value is the number of detected real objects, false positive (FN) is object detection errors, true negative (TN) is the number of real objects that failed to be detected, and false negative (FN) is the number of real objects that do not exist and are not detected.Te confusion matrix is shown in Figure 16, and we obtain the accuracy value for hot spot detection reaching 94.74% and the module detection ratio reaching 100%.Tis demonstrates comparable outcomes to the approach by Huearta et al. [31], which employs RCNN for detecting hot spots and modules but ofers the advantages of feasibility with a smaller dataset and resource efciency.Hence, this indicates that the program is in a good accuracy range and feasible for real-world application.

Power Loss Ratio Evaluation Using IV Curve.
Figure 17 explains how hot spots afect solar modules' output power and compares each confguration in the IV characteristic curve.Modules that have hot spots cause a decrease in current twice as much as the normal one, the same as the number of hot spots.Te frst decrease occurs due to a shadow efect measuring 100 × 50 mm or 20% of the cell size, while the second decrease occurs due to a shadow efect measuring 152.4 × 152.4 mm or 100% of the cell.

Journal of Electrical and Computer Engineering
Tis condition is referred to as a double step IV curve, which occurs because the PV module has hot spots on two substrings with diferent short circuit currents.Te hot spots on the two substrings activate bypass diodes connected in parallel to the substrings.Te signifcant diference in drop can occur because the current through the two bypass diodes is diferent for each substring and depends on how large the shading efect is which closes the cell until a hot spot occurs.
From this IV curve, we calculate the power loss ratio and compare it with the calculation from ( 8) and (9).Using the maximum power point of the normal condition and the hotspotted condition on the same irradiance value, the power loss ratio is 43.5%.Compared to that, by using (8) to calculate the defect ratio with the average pixel area in Figures 13 and 14 and then (9) where the activated bypass diode is two based on the hot spot in the image, the power loss ratio is 39.7%.Tus, the similarity value is 91.26% which is accurate enough and highly acceptable as the diference is relatively small.Te error may arise from inaccuracies in measuring distances and rounding during pixel per image (ppi) calculations.

Conclusion
In this work, thermography-based hot spot detection and power loss ratio estimation is proposed.Te image processing techniques are based on adaptive thresholding techniques, morphological transformation, and noise fltering to produce a bounding box around the detected hot spots and PV modules and calculate its area by the pixel density.Te detection produces hot spot detection accuracy of 94.74% and module detection accuracy of 100%.However, the proposed hot spot detection algorithm encounters challenges in identifying the second, smaller hot spot, primarily due to its dependence on pixel density.A lower pixel density can lead the program to misclassify it as noise rather than a fault.
Additionally, a power loss ratio calculation method is proposed and evaluated alongside the common measurement method of IV curves, resulting in a similarity value of 91.26%.Tis degree of similarity underscores the adequacy of the method, as the observed deviation falls within acceptable limits for real-world system applications.In conclusion, the approach demonstrates promising capabilities for hot spot detection and power loss estimation in photovoltaic systems, with potential avenues for further refnement and application.
In future research, it is necessary to investigate the integration of thermal image analysis with real-time power generation data from PV plants to enhance the accuracy of predicting the remaining useful lifetime (RUL) of PV modules, thereby enhancing the reliability of maintenance operations.Moreover, there is a compelling necessity to explore the development and implementation of autonomous fault detection and diagnostic systems within realworld PV plant setups.Such integration would substantially reduce the need for manual inspections and subsequently minimize downtime, aligning with the goal of enhancing overall operational efciency.

Figure 4 :
Figure 4: Data retrieval process and tools.(a) Solar module temperature using a contact thermometer, (b) irradiation value and ambient temperature using 200R solar survey, (c) IV curve data measurement, (d) simulated load installation on the system using battery and 500 W lamp, and (e) thermal image and visible light image collection FLIR camera.

Figure 5 :Figure 6 :
Figure 5: Program fowchart for hotspot detection using thermal and visible images.

Figure 7 :
Figure 7: Histogram method to calculate mean and deviation.

Figure 11 :
Figure 11: Calibrating lower and upper limits for PV module segmentation.

Figure 12 :
Figure 12: Noise fltering for (a) hot spot and (b) PV module edge images.

Figure 14 :
Figure 14: Hot spot detection result in pixel.(a) Detection result on larger hot spot and (b) detection result on smaller hot spot.

Figure 17 :
Figure 17: IV curve of the hot-spotted module, normal module, and combined module.

Table 1 :
Summary of IRT methodology to detect PV module faults.
4Journal of Electrical and Computer Engineering module that difer from a typical module's working heat.Some processes include binary thresholding based on the image histogram's average value and standard deviation.