Solar Inverter Data Anomaly Detection Using Improved Residual Network

In the operation of photovoltaic (PV) power plants, the health status of solar inverters is critical to system stability and energy yield. Anomalies in solar inverter data often reflect underlying faults such as sensor malfunctions, inverter damage, external intrusion, or partial shading. Traditional time-series based anomaly detection methods suffer from limited feature representation and sensitivity to noise. To address these challenges, we propose a novel approach that combines Markov Transition Field (MTF) with an improved residual network (SCCB-ResNet50) to detect anomalies in solar inverter power data. Our method first converts one-dimensional power sequences into two-dimensional images using MTF, thereby enriching feature points and enhancing discriminability. Subsequently, we introduce channel and spatial attention mechanisms (CBAM) into the ResNet-50 architecture, along with an improved Stochastic Gradient Descent (SGD) optimizer and cosine annealing learning rate schedule, to boost detection accuracy. Experimental results on a real-world solar inverter dataset demonstrate that our method achieves an AUC of 95.8%, recall of 81.5%, and accuracy of 96.0%, significantly outperforming existing approaches such as LSTM, ConvLSTM, and GANomaly.

The growing integration of renewable energy systems into power grids demands robust monitoring and fault diagnosis techniques. Solar inverters serve as the critical interface between PV arrays and the grid; any abnormal behavior in solar inverter data can lead to power losses, equipment damage, or even grid instability. Traditional anomaly detection methods for solar inverter data rely on statistical models or shallow machine learning, which often fail to capture complex temporal dependencies. Recent advances in deep learning have shown promise, particularly with convolutional neural networks (CNNs) and recurrent neural networks (RNNs). However, these methods still face challenges in handling high-dimensional temporal features and imbalanced datasets.

In this work, we present a comprehensive framework for solar inverter data anomaly detection. The key contributions are threefold: (1) We employ Markov Transition Field to transform univariate power time series into images, preserving temporal dependency information and increasing the number of feature points. (2) We design an improved residual network termed SCCB-ResNet50 by integrating CBAM (Convolutional Block Attention Module) into specific residual blocks, and by adopting an enhanced SGD optimizer with cosine annealing learning rate to accelerate convergence and avoid local optima. (3) Extensive experiments on a public solar inverter dataset from the Desert Knowledge Australia Solar Centre (DKASC) demonstrate the superiority of our method over several state-of-the-art baselines.

Methodology

Overall Framework

The proposed solar inverter data anomaly detection pipeline consists of three main stages: data preprocessing via Markov Transition Field, image-based training with the improved SCCB-ResNet50 model, and anomaly classification. First, historical solar inverter power sequences are converted into MTF images. These images are split into training, validation, and test sets. The SCCB-ResNet50 model is then trained to distinguish between normal and abnormal solar inverter operational states. During inference, the power data of a test day is transformed into an MTF image and fed into the trained model, which outputs a binary classification label (normal or abnormal). The overall architecture is summarized below.

Step 1: Markov Transition Field (MTF)
Given a time series of solar inverter power values \(X = \{x_1, x_2, \dots, x_N\}\), we first quantize the values into \(Q\) bins based on their percentiles. A Markov transition matrix \(A\) of size \(Q \times Q\) is computed, where the element \(A_{ij}\) represents the probability of transitioning from bin \(i\) to bin \(j\). The MTF matrix \(M\) is then defined as:

$$
M_{kl} = A_{q_k q_l}
$$

where \(q_k\) denotes the bin to which \(x_k\) belongs, and \(k,l = 1,2,\dots,N\). Each entry \(M_{kl}\) captures the transition probability between the states at time \(k\) and time \(l\). The final MTF image is obtained by coloring each pixel according to its probability value, resulting in an \(N \times N\) image. In our implementation, we use hourly averaged solar inverter power values (24 points per day), so \(N=24\). This transformation significantly increases the number of feature points from \(N\) to \(N^2\), enhancing the representation capability for subsequent classification.

Step 2: Improved Residual Network (SCCB-ResNet50)
The base architecture follows ResNet-50, which consists of a stem block and four residual stages (S1–S4). We modify the residual blocks by inserting a Convolutional Block Attention Module (CBAM) into the second convolutional layer of selected blocks. CBAM combines channel attention and spatial attention in a sequential manner, allowing the network to focus on important features along both channel and spatial dimensions. Figure below illustrates the modified residual block (CBAM-BTNK1 and CBAM-BTNK2).

Let \(F\) be the input feature map. The channel attention module computes:

$$
M_c(F) = \sigma(MLP(AvgPool(F)) + MLP(MaxPool(F)))
$$

where \(\sigma\) denotes sigmoid, and MLP is a shared multi-layer perceptron. The spatial attention module computes:

$$
M_s(F) = \sigma(Conv_{7\times7}([AvgPool(F); MaxPool(F)]))
$$

The output of CBAM is:

$$
F’ = M_c(F) \otimes F, \quad F” = M_s(F’) \otimes F’
$$

We place CBAM only in the second residual block of stage S4 (i.e., S4,2) based on ablation experiments (see Table below). This placement balances computational cost and performance gain.

Step 3: Optimizer and Learning Rate Schedule
We replace the standard SGD optimizer with an improved version that incorporates momentum and adaptive learning rates. The update rule is:

$$
\begin{aligned}
g_t &= \nabla f(w_t) \\
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 \\
n_t &= \alpha_1 \cdot m_t / \sqrt{v_t} \\
w_{t+1} &= w_t – n_t
\end{aligned}
$$

where \(\beta_1=0.9\), \(\beta_2=0.99\). The learning rate \(\alpha_1\) is initially set to \(2\times10^{-3}\) and decayed using a cosine annealing schedule:

$$
\eta_t = \eta_{\min} + \frac{1}{2}(\eta_{\max} – \eta_{\min})\left(1 + \cos\left(\frac{T_{\text{cur}}}{T_i}\pi\right)\right)
$$

where \(\eta_{\max}=2\times10^{-3}\), \(\eta_{\min}=0\), \(T_i\) is the total epochs per restart cycle, and \(T_{\text{cur}}\) is the current epoch. This schedule helps the model escape local minima and converge faster.

Ablation Study on CBAM Placement

We systematically replace one residual block in each stage with a CBAM-enhanced block and evaluate accuracy. The results are summarized in Table.

Table: Accuracy (%) for different CBAM placement positions
Block Position Accuracy (%) Block Position Accuracy (%)
S1,1 92.5 S3,1 93.3
S1,2 93.0 S3,2 93.5
S1,3 92.7 S3,3 93.8
S2,1 92.9 S3,4 94.2
S2,2 93.2 S3,5 94.0
S2,3 93.4 S3,6 93.9
S2,4 93.0 S4,1 94.0
S4,2 94.5
S4,3 94.1

The best accuracy (94.5%) is achieved when CBAM is inserted at S4,2. Therefore, we adopt this configuration for all subsequent experiments.

Ablation Study on Key Components

We conduct ablation experiments to validate the contributions of CBAM, improved SGD optimizer, and cosine annealing scheduler. Starting from plain ResNet-50, we sequentially add each component and evaluate AUC, recall, and accuracy on the solar inverter dataset.

Table: Ablation study results (evaluation metrics)
ResNet50 CBAM Improved SGD Cosine Annealing AUC (%) Recall (%) Accuracy (%)
93.0 76.8 92.0
94.1 79.8 94.5
94.0 80.3 94.3
93.7 79.5 93.9
95.1 80.8 94.9
94.8 80.5 94.6
95.8 81.5 96.0

The full SCCB-ResNet50 (all components) yields the best performance. Notably, CBAM alone improves accuracy by 2.5 percentage points, while the improved SGD optimizer and cosine annealing contribute further gains of 1.1% and 0.7%, respectively.

Experiments and Results

Dataset and Settings

We use the public DKASC dataset, which contains solar inverter power measurements from a PV system in Alice Springs, Australia, recorded every 5 minutes from January 2016 to January 2021. To reduce noise and weather-related fluctuations, we average 12 consecutive measurements to obtain hourly data points, resulting in 24 points per day. Each day is labeled as normal or abnormal (including sensor faults, inverter failures, shading, etc.). The dataset is split into training, validation, and test sets. All images are resized to 224×224 pixels before feeding into the network.

Our model is implemented in Python 3.8 with PyTorch. Training runs for 2000 epochs with batch size 32. The initial learning rate is \(2\times10^{-3}\) with cosine annealing restart cycles of 100 epochs. Weight decay is set to \(1\times10^{-4}\). All experiments are performed on a machine with an Intel Xeon E5-2678 v4 CPU and an NVIDIA 2080Ti GPU.

Comparison with Baselines

We compare our method (MTF + SCCB-ResNet50) with three state-of-the-art anomaly detection models: GANomaly, LSTM, and ConvLSTM. For fair comparison, all methods use the same solar inverter power data, but only our method applies MTF transformation. The results are summarized in Table.

Table: Comparison of anomaly detection methods on solar inverter data
Method AUC (%) Recall (%) Accuracy (%)
GANomaly 61.1 50.0 80.0
LSTM 83.8 72.0 85.0
ConvLSTM 91.2 77.0 81.5
Gramian Angular Field + SCCB-ResNet50 95.3 81.1 95.2
Markov Transition Field + SCCB-ResNet50 (Ours) 95.8 81.5 96.0

Our method outperforms all baselines in all metrics. Compared to the best baseline ConvLSTM, our AUC improves by 4.6%, recall by 4.5%, and accuracy by 14.5%. Moreover, we compare MTF with Gramian Angular Field (GAF) under the same SCCB-ResNet50 backbone; MTF achieves higher AUC and accuracy, confirming its superior noise robustness and feature extraction capability for solar inverter data.

ROC Curve Analysis

The Receiver Operating Characteristic (ROC) curves for the four methods are plotted. Our method consistently achieves the highest True Positive Rate (TPR) for a given False Positive Rate (FPR), indicating the best classification performance.

Case Study: Daily Anomaly Detection

We apply our trained model to two test days known to contain anomalies: September 24, 2020 (obstruction shading) and November 24, 2020 (solar inverter short-circuit). The anomaly scores produced by our method, along with those from ConvLSTM, LSTM, and GANomaly, are shown. With a threshold of 0.8, our method correctly triggers alarms on both days, while other methods miss or delay detection.

Table: Anomaly scores for two test days (threshold=0.8)
Date Actual Fault Our Score ConvLSTM Score LSTM Score GANomaly Score
2020-09-24 Obstruction shading 0.97 0.85 0.72 0.63
2020-11-24 Inverter short-circuit 0.99 0.88 0.79 0.55

Our method yields the highest anomaly scores, demonstrating superior sensitivity and reliability for solar inverter anomaly detection.

Conclusion

In this paper, we presented a solar inverter data anomaly detection method that integrates Markov Transition Field with an improved residual network (SCCB-ResNet50). The MTF transformation enriches feature representation by converting time series into images, while the carefully designed attention mechanism, optimizer, and learning rate schedule enhance classification accuracy. Extensive experiments on a real-world solar inverter dataset validated that our approach significantly outperforms existing methods such as GANomaly, LSTM, and ConvLSTM, achieving an AUC of 95.8%, recall of 81.5%, and accuracy of 96.0%. The proposed method offers a reliable solution for early detection of solar inverter anomalies, thereby contributing to the safe and stable operation of photovoltaic power systems. Future work may explore the integration of multi-sensor data and the extension to online anomaly detection in edge computing environments.

Scroll to Top