# A Deep Learning Model to Forecast Solar Irradiance Using a Sky Camera
## 4 Results and Discussion  
This section provides the results from both the RBR model used to obtain the cloud cover and the deep learning model used to forecast solar irradiance. The RBR method detects the presence of clouds by considering the ratio of the red channels to blue channels in a color image. These one-channel images combined with the threshold values were able to distinguish cloud pixels from the background. In the sky images, the cloud and sky pixels were detected as white and black colors and were further transformed from the original image into the binary image to facilitate the identification of cloud and sky pixels. However, in some cases, errors occurred when the cloud pixel was almost the same as the sky pixel. In addition, if the clouds are extremely thin, the pixels are lower than the threshold value, and they are not detected as clouds. Hence, it is essential to determine an accurate threshold value to lessen the occurrence of such classification errors. In order to understand the correlation between cloud cover and the clear-sky index, the distribution of the daily calculated cover data is presented in Figure 7, which illustrates the variation of mean cloud cover for each day. To investigate the results, the mean clear-sky index has been converted into an opposite value on account of the differences in the definition of sky conditions in relation to cloud cover and the clear-sky index; for example, in referring to cloud cover, a value of 0 is a clear-sky condition, while in the clear-sky index, a value of 0 refers to an overcast sky. The correlation between the cloud cover and the clear-sky index is worth mentioning because it shows similar trends, which indicates that the method provides satisfactory results in obtaining the cloud cover from sky images. In forecasting results, the forecast cloud cover using the LSTM model is converted into GHI data using the correlation cloud cover and clear-sky irradiance as described in Equation (3). The results for the minutes forecasting were compared with the GHI measurement in terms of evaluation metrics. The summary of solar irradiance forecasting is grouped in three categories based on sky conditions: partly cloudy, clear, and overcast days. The proposed model by modifying the coefficient in Kast  
Figure 7: Mean cloud cover distribution and mean clear-sky index for each day data. _Note_: the mean clear-sky index was changed by the opposite original value to follow the cloud cover definition. the Yoo model and the persistence model for partly cloudy days as shown in Table 3. After 10 min forecasting, the RMSD for the proposed, the Yoo, and the persistence models are 199.75 Wm\({}^{-2}\), 214.97 Wm\({}^{-2}\), and 317.94 Wm\({}^{-2}\), respectively. For reference, another forecasting model by [PERSON] et al. [7], which used the cross-correlation method (CCM) in all-sky imaging, attained an RMSD of 251 Wm\({}^{-2}\) for partly cloudy days in forecasting solar irradiance up to 10 min in advance. The results for clear days and overcast days are shown in Table 4. The results indicate that under clear day conditions the proposed model outperforms the persistence and the Yoo models for forecast horizon more than 5 min. The RMSD in 10 min forecasting for the proposed, the Yoo, and the persistence models are 43.08 Wm\({}^{-2}\), 63.74 Wm\({}^{-2}\), and 52.49 Wm\({}^{-2}\), respectively. However, the information was different on overcast days. In this case, the smallest error by the persistence model, the RMSD of 9.98 Wm\({}^{-2}\) in 10 min ahead of forecasting, demonstrated that the persistence model performed well under the overcast condition. The proposed and the Yoo models provide the RMSD of 17.37 Wm\({}^{-2}\) and 169.86 Wm\({}^{-2}\), respectively. The result in these overcast days was not surprising since the value of solar irradiance does not change significantly. The experiment by [PERSON] et al.