# Comparison of Feedforward Perceptron Network with LSTM for Solar Cell Radiation Prediction
## 4 Results and Discussion  
The training and texting process is shown in Figure 7. Loss function with 500 epochs, batch size of 256 was used for this ANN model.  
As shown in Figure 7, the minimum training MSE and minimum testing MSE were 0.0762 and 0.0775, respectively, for the ANN model. The optimum parameters selected for the ANN model were batch size 256 and learning rate 0.01.  
Figure 8 shows the graph of training and texting of data with the LSTM model for 500 epochs.  
\begin{table}
\begin{tabular}{c c} \hline Epochs & 500 \\ \hline Batch size & 16, 32, 64, 128, 256, 512, 1024 \\ \hline \(n\) & 1, 2, 5, 10, 15, 20, 30 h \\ \hline \end{tabular}
\end{table}
Table 5: Hyper parameters of the LSTM model.  
Figure 7: Loss function with 500 epochs for ANN model, batch size of 256.  
As demonstrated in Figure 8 for the LSTM model, the minimum training MSE and minimum testing MSE were 0.0049 and 0.0080, respectively. The optimum parameters selected for the ANN model were batch size 256 and past days of 15 h.  
Table 6 compares the results obtained by using the ANN model and the LSTM model. Using MSE to calculate the error/loss of the two models, it was found that LSTM improves the results about 18 times in case of training, and about 9 times in case of testing. Since LSTM successfully outperformed ANN by utilizing the data from the previous 15 h, LSTM was the chosen model to test on the 4 th year testing data.  
Figure 9 shows a sample of the prediction performed using the LSTM trained model on 175 days of the 4 th year assigned for testing the trained model. Number of days are shown on the horizontal axis versus the normalized solar radiation on the vertical axis. We calculated the coefficient of determination, R\({}^{2}\), along with the MSE for the testing results. R\({}^{2}\) was found to be 0.9365 and MSE was 0.01. In order to demonstrate the significance of our results, we compared our results to similar work in the literature by [PERSON] et al. [37] and [PERSON] et al. [60]. Moreover, [PERSON] et al. [60] predicted the solar radiation by using deep learning models for four different cities in Turkey. We averaged the values of their metric scores over the four cities to compare with ours. On the other hand, [PERSON] et al. [37] utilized wavelet transformation on the historical PV solar output at the University of Illinois in Urbana Champaign along with the meteorological data to train LSTM model to perform daily predictions. The authors compared the performance of different ML models to LSTM. Similar to our findings, LSTM outperformed the other models. They trained the models using 18 months of data and tested with one month. It is worth noting that they were performing hourly predictions for 1 day ahead.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & \multicolumn{2}{c}{**MSE**} \\ \hline \multirow{2}{*}{ANN Model} & Minimum training loss & 0.0762 \\ \cline{2-3}  & Minimum testing loss & 0.0775 \\ \hline \multirow{2}{*}{LSTM (Deep Learning)} & Minimum training loss & 0.0049 \\ \cline{2-3}  & Minimum testing loss & 0.0080 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Error comparison of models after 500 epochs.  
Figure 8: The graph of training and testing of data with LSTM model for 500 epochs.  
Table 7 demonstrates the performance of our model with respect to other similar models in the literature. Although we outperformed the other models in terms of R\({}^{2}\), [PERSON] et al. [37] achieved better results in terms of RMSE and MAE. We claim that this higher performance is due to the fact that they performed hourly prediction of the one day ahead and not the whole day. Moreover, we tested on a whole year of data and not only one month.