- Ensure you have installed the correct version of TensorFlow (GPU version is recommended).
- Core dependency libraries: Run
pip install numpy matplotlib scikit-learn pillow graphviz pydotto install required packages. - Warning: This model is computationally intensive and requires a GPU with at least 24GB of memory to run efficiently.
A computationally heavy, high-capacity CNN engineered for solar-panel fault detection. The architecture stacks residual blocks, Inception modules, depthwise-separable convolutions, and an attention mechanism to extract multi-scale features and suppress irrelevant patterns. Trained on an oversampled 4-class Kaggle dataset (1 279 images/class) with aggressive augmentation, it achieves 91.96 % accuracy and 91.6 % recall, surpassing VGG-16, ResNet50, and EfficientNet-B0. The model demands ≥ 24 GB GPU memory (RTX 4090) and outputs Grad-CAM heat-maps for explainability.
This study presents a deep learning-based image classification approach for detecting faults in solar panels. Leveraging a curated and cleaned dataset from Kaggle, the dataset was refined to four distinct classes by removing ambiguous categories. To address class imbalance and improve model generalization, data augmentation techniques such as rotation, shift, shear, zoom, and flipping were applied using TensorFlow's ImageDataGenerator. A balanced dataset of 1279 images per class was split into training (80%), validation (10%), and test (10%) sets using stratified sampling.
The proposed model architecture integrates depthwise separable convolutions, residual blocks, and Inception modules, enabling efficient multi-scale feature extraction. An attention mechanism further enhances the model’s ability to focus on critical features. The model was evaluated using key classification metrics: it achieved a recall of 0.916, an accuracy of 0.9196, an F1 score of 0.9164, and a mean specificity of 0.7551. These results indicate that the model performs with high reliability and strong generalization ability.
The model performed particularly well in the “Dusty” category, while some misclassifications in the “Physical-Damage” class suggest potential for improvement in future work. Overall, the model demonstrates robust performance in solar panel fault detection and provides a promising tool for intelligent photovoltaic system monitoring.
To build and evaluate image processing algorithms for solar panel fault detection, we use a specific dataset from Kaggle: Faulty Solar Panel Images. This dataset, provided by user kiyoshi732, is used to demonstrate the capability of our model in identifying different types of solar panel faults.
The Faulty Solar Panel Images dataset was created specifically for studying solar panel fault detection. In this project, the dataset was collected primarily through field photography and image acquisition of solar panels in simulated environments. These images cover a variety of fault types (e.g., cracks, hot spots), ensuring the dataset’s diversity and representativeness. The figure below shows some randomly selected samples from the dataset:
- Heat-map visualization
- Customized Inception block
- Attention mechanism
- Customized residual block
All results are available in this folder: https://github.com/JSLEE-0703/CNN-ResNet-Inception-for-Solar-Panel-Fault-Detection/tree/main/result%20and%20diagram
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
.jpg)


