Improved FasterNet for Solar Panel Surface Damage and Pollution Detection

In recent years, the adoption of solar energy as a clean and renewable source has surged globally, with solar panels playing a pivotal role in converting sunlight into electricity. However, the efficiency of solar panels can be significantly compromised by surface damage and pollution, such as bird droppings, dust accumulation, electrical burns, physical damage, and snow cover. Traditional inspection methods for solar panels rely heavily on manual checks, which are time-consuming, labor-intensive, and prone to human error. To address these challenges, this paper proposes an intelligent classification detection method based on an improved FasterNet model for identifying surface damage and pollution on solar panels. The approach leverages deep learning techniques to automate the inspection process, enhancing accuracy and efficiency while reducing operational costs. By integrating a parameter-free attention mechanism and optimizing the loss function, the model achieves high performance without increasing computational complexity, making it suitable for real-world applications in solar farm management.

The dataset for this study was compiled through a combination of on-site photography at a photovoltaic power plant in Jiaozhou, Qingdao, and web crawling techniques to gather diverse images of solar panels. A total of 2,502 raw images were collected, with 1,045 obtained from field surveys and 1,457 from online sources. To ensure uniformity, all images were resized to 640×640 pixels. Data augmentation methods, including random rotation, flipping, and translation, were applied to enhance dataset diversity, resulting in a final dataset of 4,320 images. These images were categorized into six classes: bird droppings (class 0), clean surfaces (class 1), dust accumulation (class 2), electrical burns (class 3), physical damage (class 4), and snow cover (class 5). This comprehensive dataset enables robust model training and evaluation for various surface conditions of solar panels.

The core of our methodology is based on FasterNet, a lightweight neural network renowned for its high computational speed and efficiency. FasterNet employs Partial Convolutions (PConv) to reduce redundancy in computations and memory access. In PConv, regular convolution is applied only to a subset of input channels for spatial feature extraction, while the remaining channels are left unchanged. This design ensures efficient memory usage and faster processing. The PConv module is followed by pointwise convolution (PWConv) to utilize information from all channels effectively, forming a T-shaped convolutional structure that focuses on central positions, as illustrated in the network architecture. The standard FasterNet consists of four hierarchical blocks, each preceded by an embedding layer (a 4×4 convolution with stride 4) or a merging layer (a 2×2 convolution with stride 2) for spatial down-sampling and channel expansion. Each FasterNet block includes a PConv layer followed by two PWConv layers, arranged in an inverted residual block with shortcut connections to reuse input features.

To enhance the detection performance for solar panel surface anomalies, we introduced two key improvements to the FasterNet model. First, we integrated the SimAM (Simple Attention Mechanism) parameter-free attention module after the first and third FasterNet blocks. SimAM draws inspiration from the human brain’s attention mechanism and uses an energy function to compute the importance of each neuron without adding extra parameters. The energy function for a neuron ( k ) in a single channel is defined as:

$$e_k^* = \frac{4(\hat{\sigma}^2 + \lambda)}{(t_k – \hat{\mu})^2 + 2\hat{\sigma}^2 + 2\lambda}$$

where ( t_k ) represents the k-th neuron in the input feature map, ( \hat{\mu} ) is the mean of all neurons in the channel, ( \hat{\sigma}^2 ) is their variance, and ( \lambda ) is a regularization term. A lower ( e_k^* ) value indicates higher neuron importance for visual processing. The output feature map ( \tilde{X} ) is then calculated as:

$$\tilde{X} = \text{sigmoid}\left(\frac{1}{E}\right) \odot X$$

where ( E ) is the energy matrix, and ( \odot ) denotes element-wise multiplication. By incorporating SimAM, the model can better focus on critical regions in solar panel images, such as damaged or polluted areas, without increasing model parameters. Second, we adopted the Adam (Adaptive Moment Estimation) optimizer as the loss function for training. Adam combines the advantages of Momentum and RMSprop, adaptively adjusting learning rates to accelerate convergence and improve stability. The update rules for Adam are based on estimates of the first and second moments of gradients, given by:

$$m_t = \beta_1 m_{t-1} + (1 – \beta_1) g_t$$
$$v_t = \beta_2 v_{t-1} + (1 – \beta_2) g_t^2$$
$$\hat{m}t = \frac{m_t}{1 – \beta_1^t}, \quad \hat{v}_t = \frac{v_t}{1 – \beta_2^t}$$
$$\theta_t = \theta
{t-1} – \alpha \frac{\hat{m}_t}{\sqrt{\hat{v}_t} + \epsilon}$$

where ( g_t ) is the gradient at time step ( t ), ( m_t ) and ( v_t ) are the first and second moment estimates, ( \beta_1 ) and ( \beta_2 ) are decay rates, ( \alpha ) is the learning rate, and ( \epsilon ) is a small constant to prevent division by zero. This optimization strategy enhances the model’s ability to handle complex patterns in solar panel images, leading to higher accuracy and faster training times.

The experiments were conducted on a hardware setup featuring an Intel Xeon Gold processor, 128GB DDR4 ECC REG memory, and an NVIDIA RTX 3060 GPU, with software environment including Ubuntu 20.04 LTS, PyTorch 1.8, and Python 3.8. The dataset was split into training, validation, and test sets, with the model evaluated using accuracy, F1 score, and confusion matrix. The formulas for these metrics are as follows:

Accuracy: $$ \text{Accuracy} = \frac{TP + TN}{TP + TN + FP + FN} \times 100\% $$

Precision: $$ \text{Precision} = \frac{TP}{TP + FP} \times 100\% $$

Recall: $$ \text{Recall} = \frac{TP}{TP + FN} \times 100\% $$

F1 Score: $$ \text{F1} = \frac{2 \times \text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} \times 100\% $$

where TP, TN, FP, and FN denote true positives, true negatives, false positives, and false negatives, respectively. The improved FasterNet model was trained with a batch size of 32 and an initial learning rate of 0.001, using cross-entropy loss and Adam optimizer over 100 epochs.

The results demonstrate the effectiveness of our improvements. As shown in Table 1, the inclusion of SimAM attention mechanism significantly boosted the model’s performance, with test accuracy increasing from 76.24% to 78.28% and F1 score from 75.84% to 77.45%, while maintaining a compact model size of 4.0 MB. This highlights SimAM’s ability to enhance feature representation for solar panel images without adding parameters.

Table 1: Impact of SimAM on FasterNet Performance
Model SimAM Module Test Accuracy (%) F1 Score (%) Model Size (MB)
FasterNet No 76.24 75.84 4.0
Improved FasterNet Yes 78.28 77.45 4.0

Furthermore, we compared the Adam optimizer with other popular optimizers, such as SGD and RMSprop, to evaluate its impact on training efficiency and performance. The loss curves during training, as illustrated in Figure 1, show that Adam achieved faster convergence and greater stability compared to SGD and RMSprop. Quantitative results in Table 2 confirm that Adam outperformed the others, with an accuracy of 76.24% and F1 score of 75.84% for the base FasterNet model, surpassing SGD by 3.79% in accuracy and 2.29% in F1 score, and RMSprop by 6.7% in accuracy and 4.06% in F1 score. This underscores Adam’s suitability for optimizing deep learning models in solar panel inspection tasks.

Table 2: Comparison of Optimizers on FasterNet
Optimizer Test Accuracy (%) F1 Score (%)
SGD 72.45 73.55
Adam 76.24 75.84
RMSprop 69.54 71.78

To provide a comprehensive evaluation, we compared our improved FasterNet model with other state-of-the-art classification models, including ResNet-50, VGGNet-16, and MobileNet-small, as summarized in Table 3. Our model achieved the highest test accuracy of 78.28% and F1 score of 77.45%, while maintaining the smallest model size of 4.0 MB. In contrast, ResNet-50 and VGGNet-16 had larger parameter sizes of 81.3 MB and 512 MB, respectively, with lower accuracy and F1 scores. MobileNet-small, though compact at 4.9 MB, performed slightly worse than our model. This comparison validates the efficiency and effectiveness of our approach for solar panel surface damage and pollution detection.

Table 3: Performance Comparison with Other Models
Model Test Accuracy (%) F1 Score (%) Model Size (MB)
ResNet-50 72.47 73.35 81.3
VGGNet-16 69.58 71.59 512
MobileNet-small 76.84 77.48 4.9
Improved FasterNet 78.28 77.45 4.0

Analysis of the confusion matrices further illustrates the improvements. The base FasterNet model showed misclassifications, particularly between similar classes like clean surfaces (class 1) and dust accumulation (class 2), due to blurred decision boundaries. After incorporating SimAM and Adam, the improved model reduced these errors, with increased values along the diagonal of the confusion matrix. For instance, class 0 (bird droppings) saw a gain of 14 correct predictions, class 1 increased by 10, class 3 (electrical burns) by 20, and class 4 (physical damage) by 8, although class 5 (snow cover) decreased by 8. This indicates enhanced discriminative power for most categories, reinforcing the value of our modifications in handling complex solar panel surface conditions.

In conclusion, this study presents an improved FasterNet-based method for intelligent detection of surface damage and pollution on solar panels. By integrating SimAM attention mechanism and Adam optimizer, the model achieves high accuracy and F1 score while remaining lightweight and efficient. The results demonstrate its superiority over existing models, making it a practical solution for automated solar panel inspection in real-world scenarios. Future work will explore additional network architectures and optimization techniques to further advance the application of deep learning in renewable energy maintenance, with a focus on enhancing robustness for varied environmental conditions affecting solar panels.

Scroll to Top