Prediction of I-V Characteristic Curve for Photovoltaic Modules Based on Convolutional Neural Network.

Photovoltaic (PV) modules are exposed to the outside, which is affected by radiation, the temperature of the PV module back-surface, relative humidity, atmospheric pressure and other factors, which makes it difficult to test and analyze the performance of photovoltaic modules. Traditionally, the equivalent circuit method is used to analyze the performance of PV modules, but there are large errors. In this paper—based on machine learning methods and large amounts of photovoltaic test data—convolutional neural network (CNN) and multilayer perceptron (MLP) neural network models are established to predict the I–V curve of photovoltaic modules. Furthermore, the accuracy and the fitting degree of these methods for current–voltage (I–V) curve prediction are compared in detail. The results show that the prediction accuracy of the CNN and MLP neural network model is significantly better than that of the traditional equivalent circuit models. Compared with MLP models, the CNN model has better accuracy and fitting degree. In addition, the error distribution concentration of CNN has better robustness and the pre-test curve is smoother and has better nonlinear segment fitting effects. Thus, the CNN is superior to MLP model and the traditional equivalent circuit model in complex climate conditions. CNN is a high-confidence method to predict the performance of PV modules.


Introduction
As well known, the problem of energy shortage in the world becomes serious. Solar energy has become an important new energy because of its cleanness and sustainability. According to the report of the International Energy Agency (IEA), the installed number of photovoltaic (PV) has been growing at a rapid speed in recent years [1]. As basic energy collection component of power generation system, the accurate and reliable modeling of PV module is quite significant in design, optimized simulation, operation and evaluation of photovoltaic power generation system [2][3][4]. The accurate results of model output could be used to get system information like maximum power point tracking (MPPT), power prediction [5][6][7][8][9][10][11]. In addition, some researchers suggest that the random forest (RF) ensemble learning algorithm and the emerging kernel based extreme learning machine (KELM) are explored for the detection and diagnosis of PV arrays early faults (including line-line faults, degradation, open circuit and partial shading). They are also based on the accurate acquisition of current-voltage (I-V) curve [12,13].
The I-V curve is an important index to characterize the performance of PV modules. It is proposed that accurate, efficient and reliable parameter extraction of solar photovoltaic (PV) models standard test environment (STC) cannot meet the requirement of real applications. It should be recognized that the modeling accuracy in the practical engineering environment are more important than in test environment. Therefore, an outdoor test platform is setup by National Renewable Energy Laboratory (NREL) in Coco, Florida, USA. This platform with an installation angle of 28.5 degrees and facing south direction is located on the peninsula southeast coast. The collected data include short-circuit current, maximum power, current and voltage of PV module in amperes when operating at maximum power, open-circuit voltage, irradiance, temperature of the PV module back-surface, ambient temperature, atmospheric pressure, relative humidity et al. In addition, there are 100 groups of current and voltage of I-V curve. The Xsi12922 [15] (Single-crystalline silicon) solar cell is used to do the test in this study.
Under the above conditions, data sets that NREL provides contain five factors, such as irradiance (G), temperature of the PV module back-surface (T 1 ), ambient temperature (T 2 ), relative humidity (H a ) and atmospheric pressure (P a ), these factors have a significant impact on the performance of PV modules [21][22][23][24][25]. Thus, performance of PV modules is tested according to these factors. In order to obtain the performance index of the Xsi12922 PV module directly, eight groups of working conditions are randomly selected for research in this study. The eight groups of working conditions are shown in Table 1. The I-V curves of this PV module corresponding to the eight working conditions are shown in Figure 1. Under the above conditions, data sets that NREL provides contain five factors, such as irradiance (G), temperature of the PV module back-surface (T1), ambient temperature (T2), relative humidity (Ha) and atmospheric pressure (Pa), these factors have a significant impact on the performance of PV modules [21][22][23][24][25]. Thus, performance of PV modules is tested according to these factors. In order to obtain the performance index of the Xsi12922 PV module directly, eight groups of working conditions are randomly selected for research in this study. The eight groups of working conditions are shown in Table 1. The I-V curves of this PV module corresponding to the eight working conditions are shown in Figure 1.  Table 1, respectively.  Table 1, respectively.

MLP Model Establishment
MLP is used in ANN and the first layer of MLP is the input layer, the middle layer is the hidden layer and the last layer is the output layer. Connection mode between these layers is full connection. Assuming that the input layer is X i = [x 1 ,x 2 ,x 3 , . . . ,x n ], the weight matrix of the hidden layer is W i = [w 1 ,w 2 ,w 3 , . . . ,w q ] and the output layer is Y i = [y 1 ,y 2, y 3 , . . . ,y n ]. Set f (·) as the activation function and x n ∈R 1*n , w n ∈R n*1 , b∈R q*n . Thus, the forward propagation mode from the input layer to the output layer is [30] Decompose (1) into a single neuron matrix In this study, Adam algorithm is used to optimize the backward propagation of MLP. Adam is a first-order optimization algorithm that improves the traditional random gradient descent (SGD) algorithm, which can deal with the noise sample and sparse gradient and has a natural annealing effect [31][32][33].

CNN Model Establishment
CNN is a kind of feed-forward neural network; it has been used in face recognition, target detection, speech recognition, optical character recognition, etc. [34][35][36]. Then it is applied to regression analysis in this study. The artificial neuron of CNN can feel the local characteristics of the sample. The features of the current layer and the next layer of CNN can be synthetically connected to achieve the effect of feeling the whole sample and each part of the sample is analyzed in this way, thus the prediction error can be reduced. A single channel CNN model is designed in this study and shown as Figure 2. It is composed of five layers, namely general input layer, convolution layer, pooling layer and full connection layer (it has two layers). Therefore, higher-level convolution neural network is evolving based on this structure.

MLP Model Establishment
MLP is used in ANN and the first layer of MLP is the input layer, the middle layer is the hidden layer and the last layer is the output layer. Connection mode between these layers is full connection. Assuming that the input layer is Xi=[x1,x2,x3,…,xn], the weight matrix of the hidden layer is Wi=[w1,w2,w3,…,wq] and the output layer is Yi=[y1,y2,y3,…,yn]. Set f(⋅) as the activation function and xn∈ 1*n , wn∈ n*1 , b∈ q*n . Thus, the forward propagation mode from the input layer to the output layer is [30] In this study, Adam algorithm is used to optimize the backward propagation of MLP. Adam is a first-order optimization algorithm that improves the traditional random gradient descent (SGD) algorithm, which can deal with the noise sample and sparse gradient and has a natural annealing effect [31][32][33].

CNN Model Establishment
CNN is a kind of feed-forward neural network; it has been used in face recognition, target detection, speech recognition, optical character recognition, etc. [34][35][36]. Then it is applied to regression analysis in this study. The artificial neuron of CNN can feel the local characteristics of the sample. The features of the current layer and the next layer of CNN can be synthetically connected to achieve the effect of feeling the whole sample and each part of the sample is analyzed in this way, thus the prediction error can be reduced. A single channel CNN model is designed in this study and shown as Figure 2. It is composed of five layers, namely general input layer, convolution layer, pooling layer and full connection layer (it has two layers). Therefore, higher-level convolution neural network is evolving based on this structure. Input of the l layer in convolution layer is x∈R l W×H×D in the three-dimensional case. Set the convolution kernel of the l layer as m∈R l W×H×D , then the number of the convolution kernel is D and the output dimension is 1 × 1 × 1 × 1 × D at the same location. Thus, D is the number of channels of layer l + 1 characterized by x l+1 and the convolution operation channel number of D l+1 is Sensors 2020, 20, 2119 where, the term of f indicates the weight matrix in CNN and (i l+1 , j l+1 ) is the convolution coordinate, which should meet In this study, the input data can be regarded as a two-dimensional 8 × 8 matrix structure and 3 × 3 convolution kernels is adopted. It can be seen that the weight matrix is the same for all inputs at different positions, which is the feature of weight sharing in convolution. In addition, a bias term can be added and in the back propagation, the learning rate of random gradient drop can be set for the weight and paranoia of this layer. If it is required, the bias of a certain position of a certain layer can also be set to zero.
Set the size of the input data volume as W 1 × H 1 × D 1 , the output size as W 2 × H 2 × D 2 , the number of convolution kernels as K, the space size of convolution kernels as f, the step size as s and the edge filling amount as p, thus the input and output shapes meet the following equation Average pooling and maximum pooling are the basic operations in the pooling layer and can be described as (9) and (10) The first layer of CNN is pool as p l ∈R l W×H×D , then the pooling results of each layer cover the original results. The core space of pooling is 2 × 2 matrix and the input data size is W 2 × H 2 × D 2 , the output size is W 3 × H 3 × D 3 , size of the core space is f, the step size is s, then the shape of the input and the output meet the following equation The neurons of CNN in the full connection layer are all connected to the activation data in the previous layer, and Adam algorithm is also used to optimize the backward propagation of CNN [31,32].

Model Training
The ANN and CNN model presented are used to predict the I-V curve, and the voltage and five environmental conditions described above are adopted as input conditions. The loss function for MLP and CNN model is defined as MAE Sensors 2020, 20, 2119 where, N is the total data set from NREL, y' i is the predicted data, y i is the measurement data. Actually, MAE is the average absolute error. Back propagation (BP) algorithm is used for the model optimization in this study. The training process of MLP and CNN is illustrated in Figure 3.
MAE is the average absolute error. Back propagation (BP) algorithm is used for the model optimization in this study. The training process of MLP and CNN is illustrated in Figure 3. Remove missing data items and randomly and uniformly select 5000 sets of data with irradiance between G=150 W/m 2 -1000 W/m² and temperature between 15-40 °C, and select the first 90% as the training set and the last 10% as the validation set. Furthermore, randomly and uniformly select 2000 sets of data with irradiance between G=150 W/m 2 -1000 W/m² and temperature between 15-40 °C as the test set.
Two layers of MLP structure are used and the activation function is set as LeakyRelu. In the MLP model, the learning rate is set as 1.75 × 10 -3 , the learning decay is 0.9, the training generation is 30, the small batch size is 500, the first layer of neurons is set as 150 and the second layer of neurons is set as 100.   Remove missing data items and randomly and uniformly select 5000 sets of data with irradiance between G = 150 W/m 2 -1000 W/m 2 and temperature between 15-40 • C, and select the first 90% as the training set and the last 10% as the validation set. Furthermore, randomly and uniformly select 2000 sets of data with irradiance between G = 150 W/m 2 -1000 W/m 2 and temperature between 15-40 • C as the test set.

Start
Two layers of MLP structure are used and the activation function is set as LeakyRelu. In the MLP model, the learning rate is set as 1.75 × 10 -3 , the learning decay is 0.9, the training generation is 30, the small batch size is 500, the first layer of neurons is set as 150 and the second layer of neurons is set as 100.
Two layers of CNN structure are used, and the activation function is also set as LeakyRelu. In the CNN model, the learning rate is set as 3.5 × 10 -4 , the learning decay is 0.9, the training generation is 30, Sensors 2020, 20, 2119 7 of 15 the small batch size is 25, the convolution kernel dimension is 50, the convolution kernel size is 3 and the hidden layer dimension is 100.
MLP and CNN models are trained according to the program flow as shown in Figure 3. The training process is illustrated in Figure 4. Figure 4a,b indicate the changes of loss function and accuracy in MLP training while Figure 4c,d indicate the changes of loss function and accuracy in CNN training. In Figure 4, Acc is defined as Two layers of CNN structure are used, and the activation function is also set as LeakyRelu. In the CNN model, the learning rate is set as 3.5 × 10 -4 , the learning decay is 0.9, the training generation is 30, the small batch size is 25, the convolution kernel dimension is 50, the convolution kernel size is 3 and the hidden layer dimension is 100.
MLP and CNN models are trained according to the program flow as shown in Figure 3. The training process is illustrated in Figure 4. Figures 4a,b    Curves 1 and 2 in Figure 4b,d show the accuracy in training set and test set respectively. It can be seen from Figure 4 that the CNN model has a fast convergence rate and a stable process while the MLP model has a relatively slow convergence rate and has a series of oscillating links. However, the final convergence values of the two models are similar.

The Accuracy Analysis
MLP and CNN are trained to obtain the optimal training models. After the test set verification of the optimal training model, the results obtained are shown in Figure 5. Figure 5a fitting effect of I-V curves predicted by MLP model and CNN model. Compared with MLP, there are fewer cusps in the nonlinear fitting curves of CNN model, thus it shows that the fitting effect of CNN model is better than that of MLP model. The cusps will greatly reduce the prediction accuracy and increase the error and the degree of difficulty in finding the maximum power for PV modules. accuracy and increase the error and the degree of difficulty in finding the maximum power for PV modules.
The evaluation terms for the I-V curves are defined as Mean Absolute Error (MAE, seen in equation (14)) and Root Mean Square Error (RMSE) and RMSE is where, N is set as 50 in this study. MAE shows the distance between the predicted value and the measured value, which is close to zero in ideal situations, while RMSE further demonstrates the degree of dispersion between the predicted value and the measured value. Obviously, smaller RMSE means higher aggregation of the errors. RMSE and MAE of the eight groups of I-V curves are shown in Table 2.
(a) (b)    (14)) and Root Mean Square Error (RMSE) and RMSE is (16) where, N is set as 50 in this study. MAE shows the distance between the predicted value and the measured value, which is close to zero in ideal situations, while RMSE further demonstrates the degree of dispersion between the predicted value and the measured value. Obviously, smaller RMSE means higher aggregation of the errors. RMSE and MAE of the eight groups of I-V curves are shown in Table 2. It can be seen from Table 2 that, when the irradiation intensity is lower than 500 W/m 2 , MAE and RMSE of MLP and CNN are relatively low, while MAE and RMSE of MLP become high when he irradiation intensity is higher than 500 W/m 2 .Thus, accuracy of the CNN model is obviously higher than the MLP model. In addition, it indicates that the aggregation of the errors of CNN is higher than that of MLP.

Analysis of the Fitting Degree
The fitting degree of the I-V curves is analyzed in the following. As we all know, Euclidean distance is the distance between two points in a metric space. Now we define the distance from the point to the line as All distances are accumulated as where, x i can be regarded as predicted value, y i can be regarded as measured value. If x i equaled y i , there would be a line like y = x. Ideally, the slope of this line is one. In fact, the predicted and measured values are scattered around the line, so it is best for θ to be close zero. In this study, the predicted value and the measured value are mapped in the same coordinate system and the analysis of the fitting degree is shown in Figure 6. Curve 1 and curve 2 in Figure 6 indicate the data points and the line like y=x. It can be seen from Table 2 that, when the irradiation intensity is lower than 500 W/m 2 , MAE and RMSE of MLP and CNN are relatively low, while MAE and RMSE of MLP become high when he irradiation intensity is higher than 500 W/m 2 .Thus, accuracy of the CNN model is obviously higher than the MLP model. In addition, it indicates that the aggregation of the errors of CNN is higher than that of MLP.

Analysis of the fitting degree
The fitting degree of the I-V curves is analyzed in the following. As we all know, Euclidean distance is the distance between two points in a metric space. Now we define the distance from the point to the line as Where, xi can be regarded as predicted value, yi can be regarded as measured value. If xi equaled yi, there would be a line like y = x. Ideally, the slope of this line is one. In fact, the predicted and measured values are scattered around the line, so it is best for θ to be close zero. In this study, the predicted value and the measured value are mapped in the same coordinate system and the analysis of the fitting degree is shown in Figure 6. Curve 1 and curve 2 in Figure 6 indicate the data points and the line like y=x.  Analysis of the fitting degree is researched by randomly selecting three group of working conditions in the test set. A large-scale analysis for CNN and MLP models are performed and the results are shown as Figures 7 and 8. Figures 7 and 8 exhibit the predicted current from MLP and CNN models under the same conditions. The error in (d) of Figures 7 and 8 is defined as y' i -y i . Figures 7 and 8 show the predicted value from both MLP and CNN models with different input variables. The irradiance (G), voltage (V), temperature of the back-surface (T 1 ), relative humidity (H a ) and atmospheric pressure (P a ) are chosen as input variables, then the comparison between the predicted and the measured value is shown in Figures 7a-c and 8a-c respectively. Figure 7d and Figure 8d show the predicted errors of the current changed with G and T 1 . It can be calculated from Figures 7a-c and 8a-c that, MAE of MLP and CNN models is 0.0671 and 0.0307 respectively and compared with MLP, CNN shows better following ability in current prediction.  By analyzing the data in Figure 7d,8d, 90% of MLP prediction error are range in 0-0.175, while 90% of CNN prediction error are range in 0-0.03. The analysis above show that the robustness and accuracy of CNN model are much higher than MLP model in I-V curves prediction for PV module.

Comparison with equivalent circuit method
Some scholars have published the calculation of I-V curve by traditional equivalent circuit and have done more in-depth research [37]. However, the accuracy of the equivalent circuit and its feasibility are still unsatisfactory. The MLP model is also compared it with traditional equivalent circuit model in detail and it is pointed out that the black box model is a simplified mathematical model and the accuracy of MLP model is higher than the equivalent circuit model under the condition of RMSE and MAE evaluation [15,21]. Thus, the black box model is investigated to further improve its accuracy. Then the black box model used in this comparative study is described as follows [15,21].
The equivalent circuit equation of the single-diode model for a solar cell is given [21].
This is the basic equation. In addition, we should also determine the transformation between parameters under standard test conditions and parameters under operating environment [21]. By analyzing the data in Figures 7d and 8d, 90% of MLP prediction error are range in 0-0.175, while 90% of CNN prediction error are range in 0-0.03. The analysis above show that the robustness and accuracy of CNN model are much higher than MLP model in I-V curves prediction for PV module.

Comparison with Equivalent Circuit Method
Some scholars have published the calculation of I-V curve by traditional equivalent circuit and have done more in-depth research [37]. However, the accuracy of the equivalent circuit and its feasibility are still unsatisfactory. The MLP model is also compared it with traditional equivalent circuit model in detail and it is pointed out that the black box model is a simplified mathematical model and the accuracy of MLP model is higher than the equivalent circuit model under the condition of RMSE and MAE evaluation [15,21]. Thus, the black box model is investigated to further improve its accuracy. Then the black box model used in this comparative study is described as follows [15,21].
The equivalent circuit equation of the single-diode model for a solar cell is given [21].
This is the basic equation. In addition, we should also determine the transformation between parameters under standard test conditions and parameters under operating environment [21].
where the I pv is the photocurrent and I o is the saturation current of the diodes; Constant q is absolute value of electric charge of an electron (1.60217646 × 10 −19 C); K is the Boltzmann constant (1.380653 × 10 −23 J/K); T is the absolute temperature of the PV cell; n denotes the ideal factor of the diode; R s is the equivalent series resistance and R sh is the equivalent parallel resistance [21]. the I pv,STC , I o,STC , R s,STC , R sh,STC and n STC are values of the five unknown parameters at the STC [21]. Where the α is temperature coefficient of the photocurrent; The β represents the irradiance coefficient of the series resistance; The E g is the energy band gap and is equal to 1.121 eV for silicon solar cell at STC. According to the equivalent circuit method shown in reference 21, there are 2000 test sets selected above calculating the I-V curve corresponding to each group of conditions. Then calculate the corresponding RMSE and MAE. Part of the results of the equivalent circuit are shown in Table 3. The results are compared with that of the MLP and the CNN models, as shown in Table 4. From above research results it can be concluded that, the prediction level of MLP and CNN based on the black box model is significantly higher than that of the traditional equivalent circuit model. Furthermore, the prediction accuracy of CNN model is obviously higher than the MLP model. The RMSE of the equivalent circuit model is about ten times higher than CNN model through the calculation of 2000 sets of data shown in Table 4. Although MLP network has some improvement, its RMSE is about twice higher than CNN model.

Conclusions
CNN model is used to predict I-V curve of silicon PV module with consideration of irradiance, temperature of the back-surface, ambient temperature, relative humidity and atmospheric pressure in the practical engineering environment instead of STC laboratory conditions. In this way, a high confidence model of Xsi12922 PV module is built. In this paper, we mainly compare two neural network models and compare them with the traditional equivalent circuit model. RMSE, MAE and regression analysis are used for large-scale evaluation and tabulation. The results show that the accuracy of CNN model is higher than that of MLP model and much higher than that of equivalent circuit model.
The advantage of CNN model is that it is based on black box model and simplifies the traditional model. Therefore, the current value can be estimated accurately only under environmental conditions without any constant measurement. At the same time, its accuracy is better than the MLP model which is the same as the black box model. In this study, the presented CNN model shows high robustness and accuracy in the I-V curve prediction for PV module, which makes it superior to the traditional model and MLP model in the application of complex climate conditions.