An AI-Based Framework Combining Categorical Alarm and Continuous Data for Power Estimation and Anomaly Detection in Photovoltaic Systems
Abstract
1. Introduction
2. Related Work and Scientific Contribution
2.1. Anomaly Detection in PV Systems Using AI
2.2. Research Gap
2.3. Scientific Contribution
- Systematic exploration of categorical inverter alarm data for PV monitoring. This study investigates an underutilized source of information generated by inverter monitoring systems: categorical alarm signals, including error codes, warning codes, and inverter state messages. While these signals are routinely recorded in operational databases, they have rarely been incorporated into data-driven predictive maintenance approaches in the PV domain. In this work, an exploratory analysis of these categorical variables is conducted, and their integration into ML-based monitoring models is evaluated, thereby establishing a baseline for future research on the use of categorical operational data in PV systems.
- Evaluation on a large-scale PV dataset. The proposed methodology is validated on a large real-world dataset comprising operational data from 126 PV inverters across multiple plants, with an approximate total installed capacity of 33.2 megawatts. This dataset is significantly larger than those typically used in previous studies, enabling a more robust evaluation of anomaly detection models under realistic operating conditions.
- Systematic comparison of ML models and categorical feature encoding strategies. This study compares the performance of several ML architectures for power prediction and anomaly detection, including both classical models and DL approaches. In addition, different encoding strategies for categorical alarm data are investigated, including one-hot encoding and embedding-based representations, providing insights into the impact of categorical data representation on model performance.
- Development of a hybrid labeling strategy and quantification of label incompleteness in O&M records. This work proposes a labeling methodology that combines O&M ticket records, rule-based shutdown detection, and expert validation through visual inspection of SCADA signals. The resulting analysis reveals that a large proportion of failure events are not documented in O&M ticketing systems and can only be identified through signal-based analysis. This result exposes a key limitation of maintenance-based labeling approaches and demonstrates the necessity of integrating data-driven methods to construct reliable ground truth datasets for PV monitoring applications.
3. Dataset and Problem Statement
3.1. Dataset Overview
3.2. Available Input Data
- Irradiance: The amount of power generated by the PV modules is directly linked with the magnitude of the solar irradiance received. This is collected from pyranometers placed at ground level at each PV plant.
- Temperature of the inverter: There is a relationship between the degradation of the inverter’s performance, and the failure of the internal components (mainly the IGBTs) and the temperature at which the inverter operates [21]. This information is collected from internal sensors inside the inverter.
- Module temperature: During high irradiance periods, it is expected to have both a large power output and high temperatures recorded in the modules. However, modules operate at lower efficiency under high-temperature conditions; therefore, it is important to monitor this measurement. This information is collected by temperature sensors mounted at the back of the module.
- Internal voltage: All of the inverters studied in this work are tri-phase inverters. The voltage in every line is measured by internal sensors inside the inverter.
- Degradation over time: Just as in every other system, in the PV field, there is degradation over time. And to accurately assess the performance of these systems over long periods (years), it is important to account for this factor. Different PV module technologies and manufacturers exhibit different degradation rates; this analysis assumes a degradation per year [22], a safe assumption for PV systems installed in cooler climates like North-Central Europe, where the studied systems are located.
3.3. Labeling Construction
- Information from the O&M ticketing system, which records interventions and reported failures in the PV system.
- A rule-based detection method designed to identify complete inverter shutdowns. Specifically, a day was labeled a failure when the inverter output remained at zero for a sustained period while the measured irradiance exceeded a predefined threshold, indicating the inverter was not producing power despite sufficient solar input.
- Manual inspection of power and irradiance time series. During model development, days flagged as anomalous by the algorithm were visually inspected. When clear abnormal patterns were observed, such as significantly lower output than expected given the irradiance, indication of string disconnection, or partial shutdown, those days were also labeled as abnormal.
- Inverter failures.
- Isolation defects.
- System failures.
- Maintenance days.
- Communication failure.
3.4. Dataset Analysis
3.5. Problem Statement
4. Methodology
4.1. Framework for Anomaly Detection in PV Systems Implementing Categorical Data: An Overview
- Power estimation with continuous data: Continuous SCADA measurements are first pre-processed by removing outliers, imputing missing values, and scaling the features. In addition, the training and validation data are filtered in the irradiance–power space to retain only samples representative of normal operating conditions. Four regression models (MLP, XGBoost, LSTM, and Mamba) are trained to estimate the expected power output. Residuals between predicted and measured power are then computed, and inverter-specific thresholds are defined. A warning is triggered when these thresholds are exceeded.
- Study of the impact of categorical data in the regression model: Additional features are derived from categorical signals generated by the inverter, including error codes, warning codes, and operational states. Since these variables cannot be directly used by most models, three transformation strategies are investigated: one-hot encoding, entity embeddings, and pattern-based feature extraction using PrefixSpan. These features are then used as input to the regression models.
4.2. Pre-Processing of Continuous Data
4.3. Feature Engineering
4.3.1. Pattern Mining by PrefixSpan
4.3.2. Feature Construction
- If the pattern is currently active.
- Count of times the pattern has occurred in the previous three days.
- Days since the pattern was last active.
- Has the pattern occurred before?
4.4. Anomaly Warning Logic
- Clipping the residuals to zero.
- Finding the threshold of anomalous behavior by the inverter.
- Raising daily alarms.
4.5. Training and Validation
Training
4.6. Validation
5. Results
5.1. Power Forecasting Results
5.2. Anomaly Detection Performance
6. Conclusions
- (i)
- Systematic exploration of categorical inverter alarm data for PV monitoring. Categorical alarm signals (including error codes, warning codes, and inverter state messages) were integrated into a data-driven monitoring framework. The exploratory analysis presented in Section 3.4 (Figure 3) shows that certain alarm codes occur disproportionately during abnormal operating periods, confirming that they carry diagnostic information complementary to continuous SCADA measurements. Three encoding strategies (one-hot, entity embeddings, and PrefixSpan-derived pattern features) were proposed and systematically evaluated in Section 4.3 and Section 5, establishing the baseline targeted by this contribution.
- (ii)
- Evaluation on a large-scale PV dataset. The methodology was validated on operational data from 126 inverters distributed across 13 plants, with an aggregated installed capacity of 33.2 MW and approximately 1045 inverter-years of operation (Table 1). This dataset is substantially larger than those used in comparable studies and made it possible to characterize model performance across heterogeneous operating conditions, as reflected by the inter-inverter variability visible in Figure 9 and Figure 10.
- (iii)
- Systematic comparison of ML models and categorical feature encoding strategies. Four architectures (MLP, XGBoost, LSTM, and Mamba) were compared under four input configurations (no categorical, one-hot, entity embeddings, prefix features). The resulting forecasting and anomaly detection metrics, summarized in Table 4 and discussed in Section 5, identify the relative trade-offs of each combination. The results show that entity embeddings outperform one-hot encoding for high-cardinality categorical inputs and that the simpler MLP architecture is the most robust across the fleet, achieving the best anomaly detection performance.
- (iv)
- Development of a hybrid labeling strategy and quantification of label incompleteness in O&M records. A three-step labeling procedure combining O&M ticket records, rule-based shutdown detection, and expert visual validation was proposed in Section 3.3. The analysis presented in Figure 4 quantifies the limited completeness of O&M-based labels, showing that most of the failures identified in this study were detected through SCADA signal analysis rather than from ticket records. This finding exposes a key limitation of maintenance-based labeling and motivates the use of hybrid, data-driven labeling pipelines for PV monitoring applications.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A. Pseudo-Code of the Proposed Framework
| Algorithm A1: Residual-based anomaly detection pipeline |
D: time-series data for all inverters F: selected explanatory variables y: measured AC power M: forecasting model family K: candidate lag/window sizes theta_low, theta_high: anomaly thresholds, e.g., 3 and 5
A: daily anomaly table with anomaly_level
|
Appendix B. Additional Failures

References
- Kurukuru, V.S.B.; Khan, M.A.; Malik, A. Failure mode classification for grid-connected photovoltaic converters. In Reliability of Power Electronics Converters for Solar Photovoltaic Applications; Institution of Engineering and Technology (IET): London, UK, 2021; Volume 170. [Google Scholar]
- Aghaei, M.; Kolahi, M.; Nedaei, A.; Venkatesh, N.; Esmailifar, S.; Moradi Sizkouhi, A.; Aghamohammadi, A.; Oliveira, A.; Eskandari, A.; Parvin, P.; et al. Autonomous Intelligent Monitoring of Photovoltaic Systems: An In-Depth Multidisciplinary Review. Prog. Photovolt. Res. Appl. 2025, 33, 381–409. [Google Scholar] [CrossRef]
- Vichare, R.V.; Gaikwad, S.R. AI-based predictive maintenance of solar photovoltaics systems: A comprehensive review. Energy Inform. 2025, 8, 128. [Google Scholar] [CrossRef]
- Akram, M.W.; Li, G.; Jin, Y.; Chen, X.; Zhu, C.; Ahmad, A. Automatic detection of photovoltaic module defects in infrared images with isolated and develop-model transfer deep learning. Sol. Energy 2020, 198, 175–186. [Google Scholar] [CrossRef]
- Le, M.; Luong, V.S.; Nguyen, D.K.; Dao, V.D.; Vu, N.H.; Vu, H.H.T. Remote anomaly detection and classification of solar photovoltaic modules based on deep neural network. Sustain. Energy Technol. Assess. 2021, 48, 101545. [Google Scholar] [CrossRef]
- Akram, M.W.; Li, G.; Jin, Y.; Chen, X.; Zhu, C.; Zhao, X.; Khaliq, A.; Faheem, M.; Ahmad, A. CNN based automatic detection of photovoltaic cell defects in electroluminescence images. Energy 2019, 189, 116319. [Google Scholar] [CrossRef]
- Qader, M.R.; Albalooshi, F.A. Boosting Solar Panel Reliability: An Attention-Enhanced Deep Learning Model for Anomaly Detection. Energies 2025, 18, 6591. [Google Scholar] [CrossRef]
- Pinho, L.S.; Sousa, T.D.; Pereira, C.D.; Pinto, A.M. Anomaly Detection for PV Modules Using Multi-Modal Data Fusion in Aerial Inspections. IEEE Access 2025, 13, 88762–88779. [Google Scholar] [CrossRef]
- Wan Suhaimi, W.S.H.; Dahlan, N.Y.; Abdul Jalil, M.A. Developing An Anomaly Detection Model for Predictive Maintenance in Large-Scale PV Systems Using Temporal Convolutional Network. PaperASIA 2025, 41, 569–579. [Google Scholar] [CrossRef]
- Ibrahim, M.; Alsheikh, A.; Awaysheh, F.; Alshehri, M. Machine Learning Schemes for Anomaly Detection in Solar Power Plants. Energies 2022, 15, 1082. [Google Scholar] [CrossRef]
- De Benedetti, M.; Leonardi, F.; Messina, F.; Santoro, C.; Vasilakos, A. Anomaly detection and predictive maintenance for photovoltaic systems. Neurocomputing 2018, 310, 59–68. [Google Scholar] [CrossRef]
- Marangis, D.; Livera, A.; Tziolis, G.; Makrides, G.; Kyprianou, A.; Georghiou, G.E. Trend-Based Predictive Maintenance and Fault Detection Analytics for Photovoltaic Power Plants. Sol. RRL 2024, 8, 2400473. [Google Scholar] [CrossRef]
- Marangis, D.; Tziolis, G.; Livera, A.; Makrides, G.; Kyprianou, A.; Georghiou, G.E. Intelligent Maintenance Approaches for Improving Photovoltaic System Performance and Reliability. Sol. RRL 2025, 9, 2500289. [Google Scholar] [CrossRef]
- Syamsuddin, A.; Adhi, A.C.; Kusumawardhani, A.; Prahasto, T.; Widodo, A. Predictive maintenance based on anomaly detection in photovoltaic system using SCADA data and machine learning. Results Eng. 2024, 24, 103589. [Google Scholar] [CrossRef]
- Pang, W.; E-Alam, M.N.; Islam, M.A. Photovoltaic array fault detection using a hybrid graph neural network and transformer architecture with multi-head attention. J. Renew. Sustain. Energy 2025, 17, 063502. [Google Scholar] [CrossRef]
- Harrou, F.; Kini, K.R.; Madakyaru, M.; Sun, Y. Anomaly Detection in Photovoltaic Systems Using Improved Independent Component Analysis. IEEE Access 2025, 13, 144307–144324. [Google Scholar] [CrossRef]
- Snytko, A.; Jiménez-Castillo, G.; Muñoz-Rodríguez, F.J.; Rus-Casas, C. Fault Diagnosis for Photovoltaic Systems: A Validated Industrial SCADA Framework. Appl. Sci. 2025, 15, 12656. [Google Scholar] [CrossRef]
- Bezerra, A.; Silva, I.; Guedes, L.A.; Silva, D.; Leitão, G.; Saito, K. Extracting Value from Industrial Alarms and Events: A Data-Driven Approach Based on Exploratory Data Analysis. Sensors 2019, 19, 2772. [Google Scholar] [CrossRef]
- Luo, M.; Li, X.; Zhang, D.; Zhao, Y.; Lim, P. Categorical data analysis for equipment failure prediction. In Proceedings of the 2008 34th Annual Conference of IEEE Industrial Electronics, Orlando, FL, USA, 10–13 November 2008; Institute of Electrical and Electronics Engineers (IEEE): New York, NY, USA, 2008; pp. 1473–1478. [Google Scholar] [CrossRef]
- Gutschi, C.; Furian, N.; Suschnigg, J.; Neubacher, D.; Voessner, S. Log-based predictive maintenance in discrete parts manufacturing. Procedia CIRP 2019, 79, 528–533. [Google Scholar] [CrossRef]
- Ruiz Amantegui, J.; Do, P.; Vu, H.C.; Pavlov, M.; Favrot, N. On the Construction of Energy Efficiency-based Degradation Indicator for Photovoltaic Solar Inverters. Annu. Conf. PHM Soc. 2024, 16, 1–10. [Google Scholar] [CrossRef]
- Jordan, D.C.; Anderson, K.; Perry, K.; Muller, M.; Deceglie, M.; White, R.; Deline, C. Photovoltaic fleet degradation insights. Prog. Photovolt. Res. Appl. 2022, 30, 1166–1175. [Google Scholar] [CrossRef]
- Wang, Q.; Huang, R.; Xiong, J.; Yang, J.; Dong, X.; Wu, Y.; Wu, Y.; Lu, T. A survey on fault diagnosis of rotating machinery based on machine learning. Meas. Sci. Technol. 2024, 35, 102001. [Google Scholar] [CrossRef]
- Hamza, A.; Ali, Z.; Dudley, S.; Saleem, K.; Uneeb, M.; Christofides, N. A multi-stage review framework for AI-driven predictive maintenance and fault diagnosis in photovoltaic systems. Appl. Energy 2025, 393, 126108. [Google Scholar] [CrossRef]
- Fan, H.; Ramamohanarao, K. Efficiently Mining Interesting Emerging Patterns. In Advances in Web-Age Information Management; Goos, G., Hartmanis, J., Van Leeuwen, J., Dong, G., Tang, C., Wang, W., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2003; Volume 2762, pp. 189–201. [Google Scholar] [CrossRef]
- Kan, J.C.; Passos, M.V.; Destouni, G.; Barquet, K.; Ferreira, C.S.; Kalantari, Z. Forecasting heat-related impacts with multivariate multi-step time series models using advanced deep learning. Sustain. Cities Soc. 2026, 137, 107142. [Google Scholar] [CrossRef]
- Ebtehaj, I.; Bonakdari, H.; Zeynoddin, M.; Gharabaghi, B.; Azari, A. Evaluation of preprocessing techniques for improving the accuracy of stochastic rainfall forecast models. Int. J. Environ. Sci. Technol. 2020, 17, 505–524. [Google Scholar] [CrossRef]
- Gu, A.; Dao, T. Mamba: Linear-Time Sequence Modeling with Selective State Spaces. arXiv 2024, arXiv:2312.00752. [Google Scholar] [CrossRef]
- Pessoa, P.; Campitelli, P.; Shepherd, D.P.; Ozkan, S.B.; Pressé, S. Mamba time series forecasting with uncertainty quantification. Mach. Learn. Sci. Technol. 2025, 6, 035012. [Google Scholar] [CrossRef]
- Kim, J.; Kim, H.; Kim, H.; Lee, D.; Yoon, S. A comprehensive survey of deep learning for time series forecasting: Architectural diversity and open challenges. Artif. Intell. Rev. 2025, 58, 216. [Google Scholar] [CrossRef]
- Oreshkin, B.N.; Carpov, D.; Chapados, N.; Bengio, Y. N-BEATS: Neural basis expansion analysis for interpretable time series forecasting. arXiv 2020, arXiv:1905.10437. [Google Scholar] [CrossRef]










| Plant ID | No. Inverters | First Date | Last Date | Installed Power (MW) |
|---|---|---|---|---|
| 1 | 1 | 2016-02 | 2025-09 | 0.28 |
| 16 | 62 | 2017-03 | 2025-09 | 17.36 |
| 19 | 3 | 2016-11 | 2025-09 | 0.84 |
| 27 | 8 | 2016-11 | 2025-07 | 2.24 |
| 31 | 5 | 2016-10 | 2025-09 | 1.40 |
| 37 | 9 | 2016-10 | 2025-03 | 2.14 |
| 38 | 5 | 2016-10 | 2025-09 | 1.40 |
| 39 | 8 | 2016-10 | 2025-09 | 1.44 |
| 40 | 3 | 2018-07 | 2025-06 | 0.84 |
| 41 | 6 | 2016-10 | 2025-09 | 1.68 |
| 42 | 8 | 2016-10 | 2025-09 | 1.80 |
| 43 | 4 | 2016-10 | 2025-09 | 0.88 |
| 57 | 4 | 2016-12 | 2025-09 | 0.90 |
| Category | Cardinality |
|---|---|
| Error code 1 | 68 |
| Error code 2 | 211 |
| Warning code 1 | 11 |
| Warning code 2 | 13 |
| State of the inverter | 21 |
| Class | Count | Percentage (%) |
|---|---|---|
| Normal | 20,093,811 | 97.53 |
| Shutdown | 508,426 | 2.47 |
| Model | Input Type | Avg. MAE | Avg. RMSE | Precision | Recall | F1 |
|---|---|---|---|---|---|---|
| MLP | Without discrete | 0.058 ± 0.026 | 0.085 ± 0.033 | 0.929 | 0.593 | 0.706 |
| One-Hot Encoded | 0.062 ± 0.028 | 0.090 ± 0.040 | 0.874 | 0.544 | 0.648 | |
| Entity Embedding | 0.057± 0.024 | 0.083 ± 0.031 | 0.915 | 0.577 | 0.686 | |
| Prefix Features | 0.066 ± 0.024 | 0.091 ± 0.028 | 0.837 | 0.517 | 0.613 | |
| XGBoost | Without discrete | 0.065 ± 0.028 | 0.090 ± 0.032 | 0.824 | 0.491 | 0.600 |
| One-Hot Encoded | 0.066 ± 0.025 | 0.090 ± 0.030 | 0.838 | 0.514 | 0.623 | |
| Entity Embedding | 0.070 ± 0.029 | 0.094 ± 0.034 | 0.869 | 0.519 | 0.639 | |
| Prefix Features | 0.070 ± 0.026 | 0.094 ± 0.030 | 0.084 | 0.502 | 0.609 | |
| LSTM | Without discrete | 0.069 ± 0.023 | 0.094 ± 0.027 | 0.881 | 0.546 | 0.646 |
| One-Hot Encoded | 0.085 ± 0.033 | 0.113 ± 0.039 | 0.879 | 0.590 | 0.673 | |
| Entity Embedding | 0.074 ± 0.028 | 0.099 ± 0.032 | 0.899 | 0.566 | 0.664 | |
| Prefix Features | 0.085 ± 0.033 | 0.114 ± 0.040 | 0.798 | 0.497 | 0.595 | |
| Mamba | Without discrete | 0.057 ± 0.024 | 0.099 ± 0.091 | 0.924 | 0.569 | 0.679 |
| One-Hot Encoded | 0.062 ± 0.024 | 0.094 ± 0.036 | 0.896 | 0.557 | 0.668 | |
| Entity Embedding | 0.070 ± 0.023 | 0.105 ± 0.033 | 0.889 | 0.554 | 0.655 | |
| Prefix Features | 0.067 ± 0.028 | 0.102 ± 0.045 | 0.810 | 0.457 | 0.554 |
| Method | Precision | Recall | F1 Score |
|---|---|---|---|
| Proposed method | 0.93 | 0.68 | 0.78 |
| Reference method [11] | 0.38 | 0.75 | 0.47 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ruiz Amantegui, J.; Vu, H.-C.; Do, P.; Pavlov, M. An AI-Based Framework Combining Categorical Alarm and Continuous Data for Power Estimation and Anomaly Detection in Photovoltaic Systems. Machines 2026, 14, 551. https://doi.org/10.3390/machines14050551
Ruiz Amantegui J, Vu H-C, Do P, Pavlov M. An AI-Based Framework Combining Categorical Alarm and Continuous Data for Power Estimation and Anomaly Detection in Photovoltaic Systems. Machines. 2026; 14(5):551. https://doi.org/10.3390/machines14050551
Chicago/Turabian StyleRuiz Amantegui, Jorge, Hai-Canh Vu, Phuc Do, and Marko Pavlov. 2026. "An AI-Based Framework Combining Categorical Alarm and Continuous Data for Power Estimation and Anomaly Detection in Photovoltaic Systems" Machines 14, no. 5: 551. https://doi.org/10.3390/machines14050551
APA StyleRuiz Amantegui, J., Vu, H.-C., Do, P., & Pavlov, M. (2026). An AI-Based Framework Combining Categorical Alarm and Continuous Data for Power Estimation and Anomaly Detection in Photovoltaic Systems. Machines, 14(5), 551. https://doi.org/10.3390/machines14050551

