# Intrahour Direct Normal Irradiance Forecasting Based on Sky Image Processing and Time-Series Analysis

Youssef Karout, Stéphane Thil, Julien Eynard, Emmanuel Guillot, Stéphane Grieu

► To cite this version:

Youssef Karout, Stéphane Thil, Julien Eynard, Emmanuel Guillot, Stéphane Grieu. Intrahour Direct Normal Irradiance Forecasting Based on Sky Image Processing and Time-Series Analysis. SolarPACES 2022, Sep 2022, Albuquerque, United States. 10.52825/solarpaces.v1i.648. [hal-04751054](https://hal-04751054)

HAL Id: hal-04751054

https://cnrs.hal.science/hal-04751054v1

Submitted on 25 Oct 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Intrahour Direct Normal Irradiance Forecasting Based on Sky Image Processing and Time-series Analysis

Youssef Karout<fnref n="1" />,<fnref n="2" />, Stéphane Thil<fnref n="1" />,<fnref n="2" />[https://orcid.org/0000-0002-2609-0687], Julien Eynard<fnref n="1" />,<fnref n="2" />[https://orcid.org/0000-0002-8011-1098], Emmanuel Guillot<fnref n="3" />[https://orcid.org/0000-0002-0552-0262], and Stéphane Grieu<fnref n="1" />,<fnref n="2" />[https://orcid.org/0000-0002-2000-3001]

## Parts of this paper were published as journal article

Karout, Y.; Thil, S.; Eynard, J.; Guillot, E.; Grieu, S. Hybrid intrahour DNI forecast model based on DNI measurements and sky-imaging data. *Solar Energy*. **2023**, *249*, 541-558.
[https://doi.org/10.1016/j.solener.2022.11.032](https://doi.org/10.1016/j.solener.2022.11.032)

**Abstract.** The present paper exhibits a hybrid model for intrahour forecasting of direct normal irradiance (DNI). It combines a knowledge-based model, which is used for clear-sky DNI forecasting from DNI measurements, with a machine-learning-based model, that evaluates the impact of atmospheric disturbances on the solar resource, through the processing of high dynamic range sky images provided by a ground-based camera. The performance of the hybrid model is compared with that of two machine learning models based on past DNI observations only. The results highlight the pertinence of combining knowledge-based models with data-driven models, and of integrating sky-imaging data in the DNI forecasting process.

**Keywords:** Direct Normal Irradiance, Sky-Imaging System, Hybrid Model

## 1. Introduction

Development of sophisticated and efficient techniques for renewable energy is a major concern nowadays. Among the various renewable energy technologies, concentrating solar power (CSP) will play a key role in the future: its share of global electricity is envisioned to reach 13-15% by 2050 [1]. Deployment of CSP technologies is penalized by various scientific and technical bottlenecks, such as the efficient control of CSP systems [2]. The H2020 project SFERA III (Solar Facilities for the European Research Area) [3] aims to tackle some of these bottlenecks, in order to achieve better competitiveness of CSP systems. One way to optimize their management is to use model predictive control, which necessitates prediction of variables of interest, and in particular DNI, which is the direct irradiance received on a plane normal to the Sun. Accurate DNI forecasts can contribute to the reduction of fluctuations of CSP plants' output due to solar irradiance intermittency and variability [4]. Intrahour DNI forecasts are thus needed, with an accurate prediction of ramp events. The main approaches to forecast solar resource are statistical models, image-based models, and numerical weather prediction (NWP) models [4]. As this work discusses DNI forecasting for short-term forecast horizons (up to 15 minutes), the focus will be on statistical and ground-based sky imagery models. A hybrid forecast model is developed, harnessing the advantages of both approaches.

<footnote n="1">¹ PROMES-CNRS (UPR 8521), rambla de la thermodynamique, Tecnosud, 66100 Perpignan, France</footnote>

<footnote n="2">² University Perpignan Via Domitia (UPVD), 52 avenue Paul Alduy, 66860 Perpignan, France</footnote>

<footnote n="3">³ PROMES-CNRS (UPR 8521), 7 rue du four solaire, 66120 Font-Romeu-Odeillo-Via, France</footnote>
## 2. Related work

Even though we are interested in DNI forecasting, the scope of this section is broadened to solar resource, since a large percentage of existing works is dedicated to GHI and photovoltaic (PV) power production forecasting. DNI forecasting is considered more complicated due its high variability. Also, CSP technologies are very sensitive to ramp events, making their accurate prediction crucial. Nonetheless, studying approaches dedicated to GHI or PV power forecasting is interesting, since parts of the forecasting procedure can be similar. Existing works can be divided according the input data used.

* Solar resource (and possibly other variables) measurements. Even if some classical time-series approaches are employed, most of the recent works are statistical models based on artificial intelligence tools [5], [6], [7]. These models can predict solar resource for horizons ranging from a few minutes to several days. However, as they are purely based on historical solar resource data, these models usually fail at accurately predicting ramp events.

* Ground-based sky images and solar resource (and possibly other variables) measurements. For these models, the forecast horizon is greatly reduced, generally culminating at 30 minutes: indeed, the information contained in sky images becomes limited as we approach their boundaries. However, using sky images allows for the prediction of atmospheric disturbances that will affect solar resource, which in turn can lead to accurate prediction of ramp events. Here, the forecast generally consists of three major steps: first, image acquisition and cloud detection; second, cloud motion estimation; and finally forecasting using extracted features. In particular, that last step can involve using a clear-sky model [8], [9], [10], [11]. Indeed, DNI can be divided into the clear-sky DNI ($DNI_{CS}$) and the clear-sky index ($k_c$) as follows:

$$DNI(t) = k_c(t) \cdot DNI_{CS}(t) \qquad (1)$$

In this paper, high dynamic range (HDR) images provided by a sky imager are fed to a machine-learning-based model, which is used to accurately detect the clouds without losing critical information in the circumsolar region. Then, the dominant cloud motion is estimated with an optical flow algorithm and clustering. An adaptive approach is then used to determine a region of interest (ROI), that may contain clouds that will block the Sun after the considered forecast horizon. All of this information is then fed to a complex artificial neural network model. The developed approach is designed to be able to forecast DNI ramps and to be robust when faced with different kinds of clouds. These topics are some of the difficulties that most models struggle with.

## 3. Hybrid model

The proposed hybrid model is presented in this section. Contrary to purely statistical models, this model relies on DNI measurements and sky images to predict DNI. Sky images are used to detect clouds and estimate their motion, so as to achieve better ramp events detection. As can be seen in its global architecture shown in Figure 1, it consists of four steps detailed in the sequel: HDR image acquisition, clear-sky DNI forecast, image processing, and DNI forecast.

<figure><img src="image_2.png" /><figcaption>**Figure 1.** The hybrid model. $CF_{ROI_H}$ is the cloud fraction in the ROI. $ROI_H^{RGB}$ is a RGB image of the region of interest. $\tilde{DNI}_{CS}$ is the forecast clear-sky DNI. $\tilde{DNI}$ is the forecast DNI.</figcaption></figure>
## 3.1 Clear-sky DNI model

In this paper, the clear-sky DNI model developed in [12] is used:

$$ \hat{DN}I_{CS}(t+H) = b \cdot I_0 \cdot \exp(-0.09\hat{m}(t+H)(\hat{T}_{LI}(t)-1)) \quad (2) $$

where:

* $b = 0.664 + 0.163 \exp(h/8000)$, with $h$ the site's altitude;

* $I_0$ is the extraterrestrial solar irradiance;

* $\hat{T}_{LI}(t)$ is the estimated Linke turbidity coefficient at time instant $t$, achieved using DNI measurements, as proposed by Nou et al. [12];

* $\hat{m}(t+H)$ is the relative optical air mass forecast at time instant $t+H$ using the following equation:

$$ \hat{m}(t+H) = (\cos(SZA(t+H)) + a_1(a_2 - SZA(t+H))^{-a_3})^{-1} \quad (3) $$

where $SZA$ is the Sun zenith angle, $a_1 = 0.50572$, $a_2 = 96.079951$ and $a_3 = 1.63643$, as proposed in [13].

## 3.2 Image processing

In this step, features are extracted from the acquired images (Figure 2). The HDR images are treated to correct the fisheye lens distortion, and used to detect clouds using a k-nearest neighbour model (k-NN) model and estimate their motion using the Farnebäck optical flow algorithm [14]. The ROI is then located based on the estimated motion with the aid of the k-means clustering method. Finally, the cloud fraction in the ROI is calculated ($CF_{ROI_H}$) and fed to the DNI forecast model that takes the RGB image of the ROI ($ROI_H^{RGB}$) as input as well.

<figure><img src="image_3.png" /><figcaption>Figure 2. Image processing steps leading to the features' calculation. $ROI_H^{RGB}$ is a RGB image of the region of interest. $CF_{ROI_H}$ is the cloud fraction in the ROI.</figcaption></figure>

## 3.3 DNI forecast model

The DNI forecast model can be divided into three main parts (see Figure 3). The first part, responsible for image feature extraction, is a convolutional neural network (CNN). The second part is a multi-layer perceptron (MLP) with the cloud fraction ($CF_{ROI_H}$) and the clear-sky DNI forecast as inputs. The outputs of the CNN and the MLP networks are then fed to a "Regression MLP", used to merge extracted features and forecast DNI at time instant $t+H$.

# 4. Results and discussion

## 4.1 Reference model

The proposed hybrid model is compared to three reference models: the smart persistence, and two recurrent neural network (RNN) models. The smart persistence model is based on
Equation 1, and the supposition that the clear-sky index $k_c$ is constant over the forecast horizon. The DNI forecast is obtained as follows:

$$ \widehat{DNI}(t+H) = k_c(t) \cdot \widehat{DNI}_{CS}(t+H) = \frac{DNI(t)}{DNI_{CS}(t)} \cdot \widehat{DNI}_{CS}(t+H) \quad (4) $$

The smart persistence model thus needs clear-sky DNI forecasts, provided by the clear-sky DNI model described in Section 3.1. The two reference RNN models are using past DNI observations as input. The first model consists of multiple layers of long short-term memory units (LSTM), followed by fully connected layers, while the second proposed model consists of a convolutional layer, LSTM layers and fully connected layers (CNN-LSTM).

<figure><img src="image_4.png" /><figcaption>**Figure 3.** DNI forecast model. $ROI_H^{RGB}$ is a RGB image of the region of interest. $CF_{ROI_H}$ is the cloud fraction in the ROI. $\widehat{DNI}_{CS}$ is the forecast clear-sky DNI. $\widehat{DNI}$ is the forecast DNI.</figcaption></figure>

## 4.2 Database and networks' training

The database used in this study consists of 373 days, during which DNI and sky images are stored every 30 seconds. DNI is measured with a pyrheliometer, and the sky images are obtained using a ground-based camera developed by PROMECA (http://promecaweb.com), with the help of PROMES-CNRS (see Figure 4). A simple classification of the database reveals 128 clear-sky days (34.4%), 49 overcast days (13.1%) and 196 days with mixed situations (52.5%). All the networks are trained using a database consisting of 40 days, selected to have examples from different seasons and with various DNI profiles. This database is then split into a training dataset of 22 days, and a test dataset of 18 days.

## 4.3 Performance metrics

In this paper, three performance metrics are used:

1. The normalized root mean squared error (nRMSE):

$$ nRMSE = \frac{\sqrt{\frac{1}{n} \sum_{t=1}^{n} (DNI(t) - \widehat{DNI}(t))^2}}{\frac{1}{n} \sum_{t=1}^{n} DNI(t)} \quad (5) $$

2. The skill factor (SF), allowing the models' performance versus the smart persistence model to be evaluated:

$$ SF = 100 \cdot \left( 1 - \frac{nRMSE_{model}}{nRMSE_{persistence}} \right) \quad (6) $$

3. The ramp detection index (RDI) [15], allowing the models' ability to predict ramps (sudden DNI variations) to be evaluated.
<figure><img src="image_5.png" /><figcaption>**Figure 4.** The PROMECA's sky imager installed in Odeillo (France) at the PROMES-CNRS laboratory and a sample HDR sky image.</figcaption></figure>

## 4.4 Forecasting results

<figure><img src="image_6.png" /><figcaption>**Figure 5.** Comparison of the LSTM model, the CNN-LSTM model and the hybrid model on mixed situations (test dataset), for $H = 5$ minutes, $H = 10$ minutes and $H = 15$ minutes.</figcaption></figure>

The performance of the hybrid, LSTM and CNN-LSTM models is compared on mixed situations in the test dataset. The results can be found in Figure 5: the hybrid model scores the lowest nRMSE values and the highest SF and RDI for each forecast horizon. This superior performance justifies the integration of HDR sky images, which translates into better ramp detection and precise DNI forecasts, compared to the models based on DNI measurements only. The CNN-LSTM slightly outperforms the LSTM model, scoring lower nRMSE and higher SF thanks to its additional convolutional layer. As can be seen, the hybrid model has the higher RDI score for each forecast horizon. LSTM and CNN-LSTM models, which are based on DNI measurements only, do not forecast DNI ramps as well as the hybrid model, justifying the use of HDR sky images in the forecasting process: cloud motion is indeed critical to better anticipate DNI variations. The LSTM model, the CNN-LSTM model and the hybrid model are now compared on 3 clear-sky days and 3 overcast days in the test database. The persistence model generally scores very low nRMSE values on such cases. As can be seen in Figure 6, the hybrid model consistently outperforms the persistence model for each forecast horizon, with SF values ranging between 6% and 9.5%. The low nRMSE values and the positive SF scored by the hybrid model confirm that the model learned to handle clear-sky and overcast situations. In addition, the model is able to compensate for seasonal changes in the maximal clear-sky DNI value thanks to the adaptive clear-sky model used. However, on such low-variability situations, the results obtained by the LSTM and CNN-LSTM models are considerably inferior to the persistence model. Contrary to the hybrid model, they are not able to correctly handle these situations, that were not included in the training database: although the nRMSE is low (around
0.16%), the persistence model is so performant that they score negative SF values (around -120% for H = 5 minutes, around -50% for H = 10 minutes and around -25% for H = 15 minutes). This demonstrates the benefits of including sky images: even though it has been trained with the same DNI measurements, the hybrid model is able to generalize to these situations.

<figure><img src="image_7.png" /><figcaption>**Figure 6.** Comparison of the LSTM model, the CNN-LSTM model and the hybrid model on clear-sky and overcast days (test dataset), for H = 5 minutes, H = 10 minutes and H = 15 minutes. The skill factor of the LSTM and CNN-LSTM models is not represented because it is too low (around -120% for H = 5 minutes, around -50% for H = 10 minutes and around -25% for H = 15 minutes). Ramp detection index is not included because there are very few ramps during these low-variability days.</figcaption></figure>

## 5. Conclusion

This paper deals with the development of a hybrid intra-hour forecast model, combining knowledge-based and machine-learning approaches and taking DNI measurements and HDR sky images as inputs. This hybrid model is compared to LSTM and CNN-LSTM models that take solely past DNI observations as input, in order to assess the benefits of integrating HDR sky images in the forecasting process. The smart persistence model is also used as reference for the comparison. Results show that the tested models are capable of outperforming the persistence model: for the hybrid model, skill factor values range from 12% to 26% as the forecast horizon increases from 5 to 15 minutes, whereas the LSTM and CNN-LSTM models score around 10% for all horizons. The ramp detection index shows that the tested models are capable of predicting DNI ramps: the hybrid model is able to forecast 72% to 80% of the ramps, whereas the LSTM and CNN-LSTM models are less efficient and detected between 53% and 66% of the ramps. This difference is due to the fact that LSTM and CNN-LSTM models are purely statistical and rely solely on past DNI observations, without taking into account the atmospheric situation: efficient cloud detection and accurate cloud motion estimation translates into better ramp detection and precise DNI forecasts. For clear-sky and overcast situations, the persistence model produces very good results, and the results obtained by the LSTM and CNN-LSTM models are considerably inferior. However, the hybrid still manages to outperform the persistence model, with skill factor values ranging from 6% to 9.5%. Thanks to the inclusion of sky images, it successfully manages clear-sky, overcast, and mixed situations. As for the complexity of the models, the analysis shows that, while the hybrid model is more complex, time-consuming, and demands more computational resources, it is still able to provide forecasts within 7% of the 30 seconds sampling time. In the framework of the European project SFERA III, the proposed model has been implemented in situ to provide real-time DNI forecasts to CSP infrastructure users.

## Data availability statement

The data presented in this study are available on request from the corresponding author.
**Author contributions**

The authors contributed equally to this work.

**Competing interests**

The authors declare that they have no competing interests.

**Funding**

This research was financially supported by the European Union's Horizon 2020 research and innovation programme under the grant agreement No. 823802 (Solar Facilities for the European Research Area - Third Phase [SFERA III]) [3].

**References**

1. P. Viebahn et al. The potential role of concentrated solar power CSP in Africa and Europe - A dynamic assessment of technology development, cost development and life cycle inventories until 2050. In: Energy Policy 39.8 (2011), pp. 4420-4430.

2. R. Chauvin. Evaluation de la ressource solaire pour la gestion optimisée de centrales CSP. PhD thesis. University Perpignan Via Domitia, 2016.

3. Project H2020 SFERA III. https://sfera3.sollab.eu.

4. E.W. Law et al. Direct normal irradiance forecasting and its application to concentrated solar thermal output forecasting - A review. In: Solar Energy 108 (2014), pp. 287-307.

5. S. Mishra and P. Palanisamy. Multi-time-horizon solar forecasting using recurrent neural network. In: 2018 IEEE Energy Conversion Congress and Exposition (ECCE). IEEE. 2018, pp. 18-24.

6. S. Malakar et al. Designing a long short-term network for short-term forecasting of global horizontal irradiance. In: SN Applied Sciences 3.477 (Mar. 2021).

7. B. Brahma and R. Wadhvani. Solar Irradiance Forecasting Based on Deep Learning Methodologies and Multi-Site Data. In: Symmetry 12.11 (Nov. 2020), p. 1830.

8. Y. Chu et al. Hybrid intra-hour DNI forecasts with sky image processing enhanced by stochastic learning. In: Solar Energy 98 (Dec. 2013), pp. 592-603.

9. S. Quesada-Ruiz et al. Cloud-tracking methodology for intra-hour DNI forecasting. In: Solar Energy 102 (Apr. 2014), pp. 267-275.

10. R. Marquez and C. F. M. Coimbra. Intra-hour DNI forecasting based on cloud tracking image analysis. In: Solar Energy 91 (May 2013), pp. 327-336.

11. M. Caldas and R. Alonso-Suarez. Very short-term solar irradiance forecast using all-sky imaging and real-time irradiance measurements. In: Renewable Energy 143 (Dec. 2019), pp. 1643-1658.

12. J. Nou et al. A new approach to the real-time assessment of the clear-sky direct normal irradiance. In: Applied Mathematical Modelling 40.15 (Aug. 2016), pp. 7245-7264.

13. F. Kasten and A. T. Young. Revised optical air mass tables and approximation formula. In: Applied Optics 28.22 (Nov. 1989), p. 4735.

14. G. Farnebäck. Two-Frame Motion Estimation Based on Polynomial Expansion. In: Image Analysis. Ed. by J. Bigun and T. Gustavsson. Berlin, Heidelberg: Springer Berlin Heidelberg, 2003, pp. 363-370.

15. Y. Chu et al. Real-time forecasting of solar irradiance ramps with smart image processing. In: Solar Energy 114 (Apr. 2015), pp. 91-104.