PV Fault Detection Using CNN For Enhancing Reliability Of Solar Power Plants Sameer Alam Department Of Electrical Engineering ZHCET, AMU ALIGARH, UTTAR PRADESH amustudent0@gmail.com Shivam Kaushik Department Of Electrical Engineering ZHCET,AMU ALIGARH , UTTAR PRADESH shivamkaushik909@gmail.com Shaikh Mohd Shaique Department Of Electrical Engineering ZHCET, AMU ALIGARH, UTTAR PRADESH shaikhshaique10@gmail.com Dr. Nidal Rafiuddin Department of Electrical Engineering ZHCET,AMU nidal.rafi@gmail.com Abstract— Solar energy presents a promising avenue for clean and abundant electricity generation. However, issues such as equipment malfunctions or inefficiencies can hinder its effectiveness. This study introduces a Convolutional Neural Networks based approach for efficient anomaly detection in photovoltaic cells, by employing deep learning Convolutional Neural Networks. The primary focus of this study is on optimizing the efficiency of anomaly detection in PV cells. The proposed project employs a comprehensive and diverse dataset comprising large sets of infrared thermal images, encompassing both anomalous and healthy infrared images of PV modules. This extensive dataset is utilized to train the Convolutional Neural Networks model, enabling precise testing of new IR image data. The model is designed such that it differentiates between healthy and faulty IR images from a given dataset. The paper conducts a thorough analysis of the proposed project, highlighting its advantages in terms of accuracy, reliability, and efficiency. This research contributes to optimizing solar power generation, ensuring its reliability and longevity. Keywords—Photovoltaic (PV), Infrared (IR), Anomaly Detection, Convolutional Neural Network (CNN), PV fault I. INTRODUCTION In the pursuit of sustainable and renewable energy sources, solar energy has emerged as a beacon of hope, offering a clean and abundant alternative to traditional fossil fuels. There are numerous benefits to switching to solar energy over fossil fuels, including the fact that solar energy is evidently limitless and emits no pollutants, while fossil fuels have a finite supply and are prone to create a lot of pollution. Solar energy is used in many ways for different heating applications, but the most important use of solar energy is in electricity generation. Evidently, electricity power demand is continuously increasing, and conventional sources of electricity generation are limited and not clean, so the whole world is looking towards non-conventional renewable energy sources. Wind, tidal, geothermal, hydro, solar, etc. are available among renewable energy sources, but among renewable energy sources, solar energy is being adopted very rapidly all over the world. The initial setup cost of solar is high, but the maintenance cost is very low as it does not use any moving systems as compared to other energy sources [2]. The most important thing in electricity generation from solar energy is photovoltaic PV cells, which work on the photoelectric effect. 979-8-3503-8719-3/24/$31.00 ©2024 IEEE The photoelectric effect is a phenomenon in which the energy of light is directly converted into electricity with the help of a PV cell. By using this process, sunlight is converted into electricity, and it offers very clean and sustainable energy. Every technology has its own set of challenges. Similarly, photovoltaic (PV) cells also face challenges such as manufacturing defects, weather conditions, bumps, dirt, ageing, etc., which reduce the efficiency of the system [3]. In all conditions that affect efficiency, we don't have control over the weather. However, if we can identify all other faults, we can improve efficiency by replacing or fixing them. Identifying faults in PV cells is a significant challenge, and ongoing research is being conducted in this field. Researchers have achieved a lot, but there is still a lot that can be improved through further research and development. Thermal images are used to identify faults in PV cells, which capture infrared images through infrared cameras. The working principle is based on the fact that where solar energy is efficiently converted into electricity, there will be less heat generation. In contrast, areas with defects or faults leading to reduced energy conversion will accumulate heat. With the help of infrared cameras, we can visually differentiate between faulty and healthy sections easily. Other technologies, such as electroluminescence images, have also been developed. In this method, PV cells are excited with a DC supply, emitting nearinfrared light captured by a special camera. Thermal infrared images are employed with machine learning techniques to detect anomalies in PV cells, achieving high accuracies up to 99.7%. By analyzing temperature variations, anomalies like hotspots and bypass substrings can be identified in PV systems. Recent research has focused on using supervised contrastive learning and deep learning to classify anomalies accurately based on thermal imaging data. This integration of thermal imaging and advanced technologies offers efficient solutions for maintaining optimal performance in PV cells [1]. Geron [4] focusses on novel signal processing detection methods, providing research avenues for all detection and classification techniques. Additionally, environment-based detection analysis is explored, contributing to the reliability of solar power plants. The chapter emphasizes the role of renewable energy sources (RES), particularly solar PV systems, in reducing carbon emissions and providing affordable energy. Vlaminck et al. [5] propose a region-based CNN for anomaly detection in PV power plants using aerial imagery. By emphasizing the importance of accurate detection, they enhance the reliability and performance of solar installations. Detecting anomalies promptly ensures optimal operation and minimizes power loss in PV systems. Rafiuddin et al. [6] suggested a method based on multi-depth wavelet packet transform capable of classifying multiple classes. II. METHODOLOGY A. CNN Artificial Neural Networks (ANNs) are computational systems inspired by the functioning of biological nervous systems, such as the human brain. They consist of interconnected computational nodes, or neurons, which work together to process information and optimize output. As shown in Figure-1, ANNs typically include input, hidden, and output layers, with deep learning involving multiple hidden layers stacked upon each other [7]. This configuration in fact aligns with the centre of several widely used ANN architectures, including recurrent neural networks (RNNs), restricted Boltzmann machines (RBMs), and feedforward neural networks (FNNs). Fig.1 Basic feedforward neural network (FNN) with an input layer, a hidden layer, and an output layer. Convolutional Neural Networks (CNNs) are a kind of deep learning model that are specifically made for processing data having a grid pattern, such as images. They are comparable to standard ANNs. They are able to automatically learn spatial hierarchies of features, from low-level to high-level patterns, and are inspired by the structure of the animal visual brain. The three primary layer types found in CNNs are convolution, pooling, and fully linked layers [8]. The fully connected layer maps the features that have been extracted to provide a final output, as classification. The convolution and pooling layers handle feature extraction. As seen in Figure-2, a convolution layer applies a kernel, a tiny grid of parameters, at each place of the input image to enable CNNs to process images quickly and effectively. Complexity increases in the retrieved features as the data moves through each layer. When training a CNN, parameters such as kernels are optimized to minimize the discrepancy between the outputs of the model and the labels that correspond to reality. The most common methods for achieving this optimization are gradient descent and backpropagation. All things considered, CNNs perform incredibly well for tasks like image processing because of their capacity to recognize and extract pertinent features from incoming data [9]. Fig.2 CNN architecture used in the study Figure-2 provides an overview of a CNN architecture and training process flow. Convolution layers, pooling layers (such as max pooling), and fully connected (FC) layers are the three main parts of a CNN. Applying a loss function during forward propagation on a training dataset is one way to assess a model's performance with particular kernels and weights. Following that, the weights and kernels that are adjustable are adjusted using a gradient descent optimization algorithm and backpropagation, with the loss value serving as the basis for refinement. CNN designs also frequently employ the ReLU (Rectified Linear Unit) activation function. The convolutional layer stands as the cornerstone within the structure of a CNN. Consisting of neurons equipped with adjustable weights and biases (parameters subject to training), it plays a pivotal role. The neurons in the initial convolutional layer establish connections solely with the pixels situated within their respective receptive fields. Similarly, neurons within the subsequent convolutional layer form connections exclusively with neurons within specific local regions in the preceding layer [10, 11]. This arrangement causes the network to prioritise detecting basic, low-level features in its initial layers, which are then combined to form more complex, highlevel features in subsequent layers. Consequently, the early layers of a CNN capture fundamental image elements such as edges, curves, and colours, while the later layers identify more intricate features like shapes. This design mirrors the way realworld images are composed, contributing to the effectiveness of CNNs in image recognition tasks. The neuron output in a convolutional layer can be mathematically expressed in eqution-1 [10]. (1) Where Zi,j,k is the output of the neuron depends on its location in the ith row and jth column of the k feature map in the convolutional layer l. In this context, the horizontal stride is represented by sw. The vertical stride is denoted by sh, the width of the receptive field is denoted by fw, the height of the receptive field is denoted by fh, and the number of feature maps of the previous layer (l-1) is denoted by fn'. The location of the neuron in the previous layer (l-1), labelled xi',j',k' can be found in the ith row and jth column of the feature map k’ (or channel k’, if it belongs to the input layer). The bias term of the k feature map in the l layer is represented as bk. In addition, the weight of the connection between any neuron k of the feature map of the l layer and its input located in the uth row and vth column and originating from the feature map k’ is indicated by wu,v,k',k. Neural networks offer advantages like fine accuracy and faster predictions compared to traditional machine learning algorithms. However, they come with drawbacks such as high computational demands and the need for extensive training data. Within neural networks, CNNs have several advantages over fully connected deep neural networks (DNNs) for image classification [10]. 1. CNNs have fewer parameters, leading to faster training, reduced overfitting, and requiring less training data. 2. Once CNN learns a filter for a specific feature, it can detect that feature anywhere in the image, leveraging the repetitive nature of image features for better generalization. 3. CNNs have an advantage over DNNs, especially when it comes to real-world natural images, because their bottom layers identify lower-level features, and their upper layers integrate these features into larger, higher-level features. Table 1. Descriptions of each 12 types of classes Class Description Cell Represents a single cell exhibiting a square geometry that has undergone a hot-spot event. Cell-multi Denotes hot spots occurring in multiple cells, each characterized by a square geometry. Cracking Indicates the presence of visible surface cracks on the module. Diode Refers to an active bypass diode, typically constituting 1/3 of the module. Diode-multi Signifies the activation of multiple bypass diodes, typically accounting for 2/3 of the module Hotspot Describes the development of a thermal hotspot on a thin-film module. Hotspot-multi Represents the formation of multiple thermal hotspots on a thin-film module. Offline-module Denotes the entire module being subjected to heating. Shadowing Refers to sunlight obstruction caused by vegetation, man-made structures, or adjacent rows. Soiling Indicates the presence of dirt, dust, or other debris on the module surface. Vegetation Represents panels obstructed by surrounding vegetation. No-anomaly Indicates normal operation of the solar module. B. DATASET The dataset utilized for training comprises infrared thermal images, focusing on two major classes: Faulty and Healthy. Within these classes, there are distinct anomalies and normal instances represented by thermal images of solar PV cells. Specifically, the dataset encompasses 11 fault categories, contributing a total of 2000 images to the Faulty class. These anomalies include cell, cell multi, hotspot, hotspot multi, vegetation, soiling, offline module, diode, diode multi, cracking, and shadowing. Conversely, the Healthy class comprises 2000 images representing PV cell units devoid of any anomalies. These images depict the normal operational conditions of PV cells, serving as a reference for comparison during the training process. The descriptions for each of the 12 types are shown in Table 1 [13]. The sample images representing non-anomalous and anomalous data are shown in figure-3. During training, CNN learns to distinguish between these two classes based on the thermal patterns exhibited in the images. By analyzing the thermal characteristics associated with faulty and healthy PV cells, the CNN becomes adept at identifying anomalies and classifying PV cell units accordingly. This balanced representation of both faulty and healthy instances within the dataset ensures that the CNN receives sufficient exposure to diverse scenarios, enabling it to generalize well and achieve high accuracy in fault detection and classification tasks. C. TRAINING MODULE ((a)) (b) Fig.3 Infrared images of PV module for (a) Non-anomalous (b) Anomalous The training module utilizes pretrained SqueezeNet CNN architecture. The process involves selecting and preprocessing a dataset, initializing the model with SqueezeNet architecture, choosing a loss function and optimization algorithm, and iterating through training epochs to update model parameters. Fine-tuning and hyperparameter tuning optimize performance. Monitoring metrics like loss and accuracy ensure effective training, resulting in a model ready for real-world inference tasks. The pretrained SqueezeNet model was trained on a single GPU, with adam solver, initial learning rate of 0.0001 and mini-batch size of 128. Further, L2 regularization was set at 0.0001. During each epoch of the training process shuffling is done to introduce randomness into the training data, ensuring robustness and generalization. D. TESTING The testing phase of the SqueezeNet involves loading the pretrained model and evaluating its performance using a separate test dataset. By performing a forward pass, predictions are obtained and compared with ground truth labels to assess accuracy or other relevant metrics. Analysis of results provides insights into the model's generalization ability and identifies areas for potential improvement. III. TRAINING RESULT The training was conducted using the SqueezeNet CNN architecture on 4000 images categorized into two balanced classes: faulty IR thermal images and healthy images. Each class contained 2000 images, ensuring equal representation for both healthy and faulty instances. The faulty class encompassed approximately 2000 images, featuring eleven distinct types of anomalies, including cell, cell multi, hotspot, hotspot multi, vegetation, soiling, offline module, diode, diode multi, cracking, and shadowing. To maintain class balance, an equal number of instances were included for each anomaly type. The healthy class consisted of 2000 images devoid of any anomalies, serving as the baseline for comparison against the faulty instances. Figure-4 and Figure5 illustrate the training progress of the SqueezeNet considering accuracy and loss metrics respectively. Both training accuracy and validation accuracy exhibit an increasing trajectory, suggesting that the model effectively learns from the training data and generalizes to validation data. Additionally, training loss and validation loss consistently decrease over iterations. This reduction indicates that the model optimally adjusts its parameters during training. This underscores the robustness of the CNN model in learning complex patterns inherent in IR thermal images, thereby enabling accurate classification of healthy and faulty instances. (a) (b) Fig 5. loss vs Iteration (a) Training (b) Validation During training, the CNN model exhibited exceptional performance, achieving a training accuracy of 99% and a validation accuracy of 89%. Considering the complexity of the task, this high accuracy demonstrates the efficacy of the model in distinguishing between healthy and faulty IR thermal images. After the completion of training, the loss factor converged to 0.1, indicating that the model effectively minimized the discrepancy between predicted and actual labels during training iterations. IV. CONCLUSION (a) (b) Fig 4. Accuracy v/s Iteration (a) Training (b) Validation In conclusion, this research presents a significant advancement in the field of anomaly detection in photovoltaic cells through the utilization of Convolutional Neural Networks. The study focuses on optimizing the efficiency and accuracy of anomaly detection in PV cells, addressing the critical challenge of maintaining optimal performance in solar power generation systems. By leveraging a comprehensive dataset comprising infrared thermal images, encompassing both healthy and anomalous instances, the proposed CNN-based approach demonstrates remarkable capabilities in accurately distinguishing between faulty and healthy PV cells accuracy. The model's training process, utilizing the SqueezeNet architecture, resulted in exceptional performance metrics, with a training accuracy of 99% and a validation accuracy of 89%. The effectiveness of the CNN model in anomaly detection is evidenced by its ability to identify various anomalies, including hotspots, vegetation, soiling, and others, with high precision. The model's robustness is further highlighted by its capability to generalize well across diverse scenarios, ensuring reliable performance in real-world applications. Overall, this research contributes significantly to optimizing solar power generation systems by enhancing anomaly detection capabilities, thereby ensuring the reliability, longevity, and efficiency of PV cells. The findings underscore the potential of deep learning techniques, particularly CNNs, in addressing complex challenges in renewable energy technology, paving the way for a sustainable and greener future. REFERENCES 1. M. Alsafasfeh, I. Abdel-Qader, and B. Bazuin, “Photovoltaic defect classification through thermal infrared imaging using a machine learning approach,” Progress in Photovoltaics: Research and Applications, vol. 27, no. 10, pp. 1007–1016, Oct. 2019. 2. A. Maka and J. Alabid, “Solar energy technology and its roles in sustainable development,” Clean Energy, vol. 6, pp. 476–483, 2022. DOI: 10.1093/ce/zkac023. 3. A. M. Soomar, A. Hakeem, M. Messaoudi, P. Musznicki, A. Falak, and S. Czapp, “Solar Photovoltaic Energy Optimization and Challenges,” Frontiers in Energy Research, vol. 10, article 879985, 2022. DOI: 10.3389/fenrg.2022.879985. 4. Gawre, S.K. (2022). “Advanced Fault Diagnosis and Condition Monitoring Schemes for Solar PV Systems.” In: Bohre, A.K., Chaturvedi, P., Kolhe, M.L., Singh, S.N. (eds) Planning of Hybrid Renewable Energy Systems, Electric Vehicles and Microgrid. Energy Systems in Electrical Engineering. Springer, Singapore. DOI: 10.1007/978-981-19-0979-5_3. 5. Vlaminck, Michiel, Rugen Heidbuchel, Wilfried Philips, and Hiep Luong. (2022). “Region-Based CNN for Anomaly Detection in PV Power Plants Using Aerial Imagery.” Sensors, 22(3), 1244. DOI: 10.3390/s22031244. 6. N. Rafiuddin, Y. U. Khan, and O. Farooq, “A Novel Wavelet Approach for Multiclass iEEG Signal Classification in Automated Diagnosis of Epilepsy,” IEEE Transactions on Instrumentation and Measurement, vol. 71, pp. 1–10, 2022. 7. K. O’Shea and R. Nash, “An Introduction to Convolutional Neural Networks,” ArXiv e-prints, arXiv:1511.08458, Nov. 2015. 8. D. H. Hubel and T. N. Wiesel, “Receptive fields and functional architecture of monkey striate cortex,” Journal of Physiology, vol. 195, pp. 215–243, 1968. 9. K. Fukushima, “Neocognitron: a self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position,” Biological Cybernetics, vol. 36, pp. 193–202, 1980. 10. R. Yamashita, M. Nishio, R. K. G. Do, et al., “Convolutional neural networks: an overview and application in radiology,” Insights Imaging, vol. 9, pp. 611–629, 2018. DOI: 10.1007/s13244-018-0639-9. 11. A. Geron, Hands-on Machine Learning with Scikit-Learn and TensorFlow, O’Reilly Media USA, 2017. 12. S. Ioffe and C. Szegedy, “Batch normalization: accelerating deep network training by reducing internal covariate shift,” in Proceedings of the 32nd International Conference on Machine Learning (PMLR), vol. 37, 2015, pp. 448–456. 13. Millendorf, M.; Obropta, E.; Vadhavkar, N. Infrared solar module dataset for anomaly detection. In Proceedings of the 2020 International Conference on Learning Representations (ICLR), Addis Ababa, Ethiopia, 30 April 2020