Enhancing Solar Panel Surface Defect and Contamination Detection Using an Improved FasterNet Model

In the pursuit of efficient solar energy utilization, maintaining the integrity of solar panels is critical. Surface defects and contamination, such as dust accumulation, bird droppings, electrical burns, and snow coverage, significantly reduce energy conversion efficiency. Traditional manual inspection methods are labor-intensive and error-prone, necessitating automated solutions. This study proposes an enhanced FasterNet model for intelligent solar panel defect and contamination classification. Our approach integrates a parameter-free attention mechanism and adaptive optimization, achieving high accuracy while maintaining computational efficiency.


1. Introduction

Solar panels are pivotal in harnessing renewable energy, yet their performance degrades due to surface damage and contamination. Existing deep learning methods, such as YOLO variants and CNNs, have shown promise in defect detection but often suffer from high computational costs or insufficient accuracy for multi-class contamination classification. To address these limitations, we present an improved FasterNet architecture tailored for solar panel inspection. Our contributions include:

  • solar panel surface defect dataset comprising 4,320 labeled images.
  • Integration of SimAM, a parameter-free attention mechanism, to enhance feature extraction.
  • Adoption of the Adam optimizer for accelerated convergence and stability.
  • Comprehensive benchmarking against ResNet, VGGNet, and MobileNet models.

2. Methodology

2.1 Dataset Construction

We collected 1,045 on-site images from a solar farm in Qingdao, China, and supplemented them with 1,457 web-crawled images. After augmentation (rotation, flipping, and translation), the dataset expanded to 4,320 images categorized into six classes:

  • Class 0: Bird droppings
  • Class 1: Clean panels
  • Class 2: Dust-covered panels
  • Class 3: Electrical burns
  • Class 4: Physical damage
  • Class 5: Snow coverage

All images were resized to 640×640640×640 pixels to standardize input dimensions.

2.2 Improved FasterNet Architecture

The original FasterNet employs PConv (Partial Convolution) layers to reduce redundancy by processing only a subset of channels. We enhanced this backbone with two modifications:

2.2.1 SimAM Attention Mechanism
SimAM leverages a neuroscience-inspired energy function to weight neurons without introducing additional parameters. The energy ek∗ek∗​ for the kk-th neuron in a channel is computed as:ek∗=4(σ2+λ)(μ−tk)2+2σ2+2λek∗​=(μtk​)2+2σ2+2λ4(σ2+λ)​

where μμ and σ2σ2 denote the mean and variance of neurons in the channel, and λλ is a regularization term. Lower energy indicates higher importance. The output feature map X~X~ is then:X~=sigmoid(1E)⊙XX~=sigmoid(E1​)⊙X

where EE is the energy matrix. We inserted SimAM after the first and third FasterNet blocks to prioritize critical spatial features in solar panel images.

2.2.2 Adam Optimization
The Adam optimizer combines momentum and adaptive learning rates, defined as:θt+1=θt−η⋅m^tv^t+ϵθt+1​=θt​−ηv^t​​+ϵm^t​​

where m^tm^t​ and v^tv^t​ are bias-corrected estimates of the first and second moments of gradients. Adam outperformed SGD and RMSprop in preliminary tests, reducing training oscillations and accelerating convergence.


3. Experimental Setup

3.1 Hardware and Software Configuration

  • Hardware: Intel Xeon Gold CPU, NVIDIA RTX 3060 GPU, 128GB RAM.
  • Software: PyTorch 1.8, Python 3.8, Ubuntu 20.04.

3.2 Evaluation Metrics

Performance was assessed using:

  • Accuracy: Accuracy=Tp+TnTp+Tn+Fp+Fn×100%Accuracy=Tp​+Tn​+Fp​+FnTp​+Tn​​×100%
  • F1 Score: F1=2⋅Precision⋅RecallPrecision+Recall×100%F1​=Precision+Recall2⋅Precision⋅Recall​×100%
  • Confusion Matrix: To analyze per-class misclassification.

4. Results and Discussion

4.1 Impact of SimAM

Adding SimAM improved classification accuracy by 2.04% and F1 score by 1.61%, as shown below:

ModelAccuracy (%)F1 Score (%)Parameters (MB)
FasterNet76.2475.844.0
FasterNet+SimAM78.2877.454.0

The attention mechanism enhanced focus on subtle defects like dust (Class 2) and electrical burns (Class 3), reducing confusion with clean panels (Class 1).

4.2 Optimization Function Comparison

Adam achieved superior accuracy and stability compared to SGD and RMSprop:

OptimizerAccuracy (%)F1 Score (%)
SGD72.4573.55
RMSprop69.5471.78
Adam76.2475.84

Adam’s adaptive learning rates mitigated gradient noise, particularly beneficial for imbalanced solar panel classes.

4.3 Benchmarking Against State-of-the-Art Models

Our model outperformed ResNet-50, VGG-16, and MobileNet-small:

ModelAccuracy (%)F1 Score (%)Parameters (MB)
ResNet-5072.4773.3581.3
VGG-1669.5871.59512
MobileNet-small76.8477.484.9
Our Model78.2877.454.0

The compact size (4.0 MB) and high accuracy make our model suitable for edge devices in solar farms.

4.4 Confusion Matrix Analysis

Post-improvement, misclassification between Classes 1 (clean) and 2 (dust) decreased by 10%, while Class 3 (electrical burns) saw a 20% accuracy boost. Diagonal values in the confusion matrix improved uniformly, validating the efficacy of SimAM and Adam.


5. Conclusion

We proposed an enhanced FasterNet model for solar panel surface defect and contamination detection. By integrating SimAM and Adam, our method achieved 78.28% accuracy and 77.45% F1 score with minimal computational overhead. Future work will explore hybrid architectures and real-time deployment on drones for large-scale solar farm inspections.

Scroll to Top