# A State-of-Art-Review on Machine-Learning Based Methods for PV
## 5 The Latest Research on Anomaly Detection (a.k.a. Fault Detection) and Diagnosis in PV  
This section reports the latest research papers, i.e., published during the year 2018-2019, concerning anomaly detection (AD), in some papers also indicated as fault detection (FD), in PV.  
This research field counts fewer papers if compared to papers concerning PV power forecasting, but it is a very interesting field in terms of the suitability of ML-based methods to automatically detect and classify anomalies or better provide predictive maintenance. PV plants are subject to many different faults during their life; these faults can lead simply to a power loss or even pose a hazard risk due to fires. To have the idea of the likelihood of power loss coming from faults, this can vary from 3.6% during the first year of life to 18.9% after three years of life, as stated in [57] that analyzed some domestic PV systems in the UK. Typical PV faults can be detected automatically using ML-based methods essentially using three methodologies:  
1. Analysis of string/panel current and/or voltage, or current/voltage measured at the inverter with the use of exogenous variables as environmental ones,
2. Image analysis performed mainly by infrared (IFR) images detected by Unmanned Aerial Vehicle (UAV),
3. Clustering-based techniques that can detect anomalies using unlabelled data.  
For the methodology at point 1, the most frequently used methods include ANN, FL, Decision Tree (DT) and RF. For point 2 above, DL is the most suitable, and various types of CNN have been employed in this regard.  
The third methodology reported above counts essentially k-Nearest Neighbour (kNN), one class SVM (1-SVM) or more recent algorithms as Isolation Forest (IS) or Local Outlier Factor (LOF). This field of research often deals with a dataset of unlabelled data and/or where the faults are, fortunately, very few, resulting in a highly unbalanced dataset (few faults and majority of data fault-free). For this reason, the normal accuracy metric is not well suited to accurately represent the model's performance. Nonetheless, many papers report only traditional accuracy while better metrics could be Balanced Accuracy, F1 score [58], Cohen's Kappa [59] or Matthews Correlation Coefficient (MCC) [60]. Moreover, for the reason outlined above, very often the dataset used to train and test the model is ad hoc simulated and not derived from a real plant; this can overcome the problems related to an unbalanced dataset, as many faults as desired can be created/simulated, and the issue concerning the labeling can be resolved, i.e., accurately describing what type of fault occurred and where and at which timestamp; but, at the same time, this could be not representative of a real functioning plant. It is probable that the optimal approach could be to employ both simulated and real data with ad-hoc created faults. The remainder of this section will present:  
* A discussion of anomalies/faults analyzed in literature with ML-based methods
* Suggestions on which approach from the most current literature review (from 2018 till 2021) seems to produce better results
* Common challenges and insight on possible future trends