An improved cloud recognition and classification method for photovoltaic power prediction based on total‐sky‐images

The Journal of EngineeringVolume 2019, Issue 18 p. 4922-4926 The 7th International Conference on Renewable Power Generation (RPG 2018)Open Access An improved cloud recognition and classification method for photovoltaic power prediction based on total-sky-images Jiacheng Tang, Corresponding Author Jiacheng Tang 11610055@zju.edu.cn College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorZeyan Lv, Zeyan Lv College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorYong Zhang, Yong Zhang College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorMiao Yu, Miao Yu College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorWei Wei, Wei Wei College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this author Jiacheng Tang, Corresponding Author Jiacheng Tang 11610055@zju.edu.cn College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorZeyan Lv, Zeyan Lv College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorYong Zhang, Yong Zhang College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorMiao Yu, Miao Yu College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this authorWei Wei, Wei Wei College of Electrical Engineering, Zhejiang University, Hangzhou, 310007 Zhejiang Province, People's Republic of ChinaSearch for more papers by this author First published: 28 May 2019 https://doi.org/10.1049/joe.2018.9249Citations: 4AboutSectionsPDF ToolsRequest permissionExport citationAdd to favoritesTrack citation ShareShare Give accessShare full text accessShare full-text accessPlease review our Terms and Conditions of Use and check box below to share full-text version of article.I have read and accept the Wiley Online Library Terms and Conditions of UseShareable LinkUse the link below to share a full-text version of this article with your friends and colleagues. Learn more.Copy URL Share a linkShare onFacebookTwitterLinkedInRedditWechat Abstract The rapid variation of irradiance due to cloud movements and occlusions is the main factor causing the fluctuation of photovoltaic (PV) power generation. Accurate recognition and classification of cloud is the prerequisite of improving the prediction accuracy of irradiance. Total-Sky-Images (TSIs) taken by ground-based cameras are a good solution to analyse the distribution of cloud in real-time and is suitable for ultra-short-term PV power prediction. Images are often processed by threshold-based segmentation algorithm, which is based on the brightness or greyscale value of pixels. However, the sunlight can change the brightness or greyscale distribution of those pixels which represent cloud and cause misclassification. This paper proposes a novel cloud classification method based on greyscale compensation values (GCVs) and Otsu algorithm to solve this problem and divides the total sky into three parts: clear sky, thin cloud and thick cloud. GCVs are greyscale values which extract from clear-sky TSIs. Experimental results show that this method can effectively improve the accuracy of cloud classification. 1 Introduction Solar energy is a promising renewable energy because of its cleanness, safety, flexibility and inexhaustibility. In recent years, numbers of large-scale PV power plants have been connected to the power grid to meet the growing demand for electricity. At the same time, the distributed generation systems with 100% renewable energy attract more and more researchers' attention, most of which contain PV units. With the increase of PV penetration rate, balancing power production and consumption is getting more and more challenging due to the rapid fluctuations of irradiation which is mainly caused by clouds' occurrence, disappearance and movement. Therefore, the accurate prediction of irradiance has great significance for power consumption. Although many factors make cloud-induced fluctuations difficult to predict, solar irradiance prediction techniques have been successfully developed recently [1]. Physical methods (such as numerical weather models (NWPs) [2] and satellite-based methods [3]) and statistical methods (such as time series analysis [4] and artificial neural network techniques [5]) are mainly used for day-head or several-hour-ahead prediction. For ultra-short-term irradiance prediction with minutes ahead, recent researches focus on total-sky-images (TSI) taken from kinds of ground-based cameras. A set of sky images can be used to identify clouds and then predict the movement of clouds in minutes, among which cloud identification is the basis of photovoltaic power prediction. Cloud recognition is generally based on a thresholding technique that divides pixels of images into several parts determined by cameras' red-green-blue (RGB) channel magnitudes or hue, saturation and luminance (HSL) colour-space [6]. Ref. [7] uses a fixed red-blue ratio (RBR) threshold to identify clouds. The pixels whose RBR are less than 0.6 are labelled as clear sky. On the contrary, they are labelled as cloud. Ref. [8] characterised clear sky, cloud and other conditions based on fixed HSL thresholds. Ref. [9] use the adaptive thresholding technique based on the Otsu algorithm to identify clouds and performs better than the fixed thresholding technique. Besides, hybrid thresholding technique is also developed based on both fixed and adaptive thresholds [10]. However, none of these methods consider the impact of the sun on selecting the optimal threshold. It is a fact that from the ground-based view the farther away from the sun, the less sunlight cloud will receive, which can be reflected by greyscale value of images. So similar clouds may be mistakenly divided into different categories. This paper proposes a novel method to deal with cloud misclassification issues on the situation when the greyscale values of cloud pixels are affected by uneven sunlight. The proposed method first uses Blue-Red-Blue-Green ratio (BRBG) algorithm to divide the image into clear sky and cloud. The cloud parts of the image are extracted and turned into a greyscale image. Then a new greyscale image is generated by adding a greyscale compensation value (GCV) to each pixel. Ultimately, an optimal threshold is adaptively achieved to distinguish between thin cloud and thick cloud. The remainder of this paper is organised as follows. In Section 2, the data acquisition and pre-processing are discussed. Section 3 presents the proposed cloud recognition and classification method. The experimental results and analysis are discussed in Section 4. In Section 5, the major contributions of this paper are summarised. 2 Data acquisition and Pre-processing In this paper, TSIs are taken from EKO all-sky-camera(ASC) installed on the roof of the School of Physics at Peking University, Beijing, China. The ASC's coordinates are 116.23 degrees longitude east and 39.99 degrees latitude north. This camera consists of a fisheye lens which has a wide view of almost 180 degrees and a highest resolution of 2272*1704 pixels, and the aperture and the shutter are adjustable. The default shooting interval is 10 min and can be changed down to a minimum of 1 min. The appearance and position of ASC are shown in Fig. 1. Fig. 1Open in figure viewerPowerPoint Appearance and position of ASC The raw images need to go through multiple operations to be transformed into pre-processed images. Due to the inherent characteristics of the fisheye lens, the closer an object is to the edge of an image, the more severe the distortion could be. Besides, some buildings around the ASC block part of the sky. Since clouds which are at the edge of images have less effect on PV power prediction, we only take clouds within a certain zenith angle into consideration. Then fisheye rectification is performed. Some parameters of TSIs are shown in Table 1. Table 1. Some parameters of TSIs Raw TSI Pre-processed TSI resolution 2272*1704 1500*1500 aperture auto auto underexpose −2 −2 interval 1 min 1 min direction counter clockwise visual field 180° 140° The example of a raw image and its pre-processed image is shown in Fig. 2. Fig. 2Open in figure viewerPowerPoint Raw and pre-processed images (a) Raw TSI. (b) The pre-processed image 3 Proposed method 3.1 Sun positioning One way to determine the position of the sun is to scan images for the brightest area. However, it does not work very perfectly because optically thin clouds and aerosol particles can be intensely illuminated by the sun and considerably deviate the sun positioning process [11]. So we choose a computational approach due to the sun's periodic movement. In a site-centric polar coordinate system, the orientation of the sun can be represented by the solar altitude angle and azimuth angle, which is shown in Fig. 3 (a). Fig. 3Open in figure viewerPowerPoint The basis of sun positioning (a) Position of the sun in site-centric polar coordinate system. (b) An ideal fisheye lens The solar altitude angle Hs and the azimuth angle As is calculated by latitude φ, declination angle δ and time angle ta. The declination angle δ is calculated as (1) where n represents n-th day of a year. The time angle ta is calculated as (2) where tts represents true solar time, which has a difference with local time and the difference can be looked up. According to Equation (1-2), the solar altitude angle Hs and the azimuth angle As are calculated as follows: (3) (4) For an ideal fisheye lens, the image radius relates linearly to the view angle, and the whole field of view will be mapped to concentric circles. As shown in Fig. 3(b): (5) where R is the radius of the pre-processed images and rHs the distance between sun point and centre point of the image. Suppose the location of the sun in pre-processed images is (x, y) and the original point is in the centre of the image. South is the positive direction of the x- axis and east South is the positive direction of the y-axis. Equation (6) shows the representation of (x, y). (6) 3.2 Cloud recognition based on BRBG algorithm and segmented threshold Sunlight is composed of a variety of light with different wavelengths. The Rayleigh Scattering theorem shows that the shorter the wavelength of light, the lower the scattering intensity. According to this theorem, the scattering of red and green light is weaker while the scattering of blue light is stronger. So red and green light can pass through the clean sky but be reflected by cloud, that can be presented in images. The intensities of the red and green components in the sky pixels are lower than in cloud pixels. An algorithm based on BRBG threshold Th0 is used to describe this difference. The BRBG value Th is calculated as follows: (7) where R, G, B are the red, green, blue components of RGB values. The pixels whose Th are more than the threshold Th0 are labelled as sky, otherwise they are labelled as cloud. Compared with conventional RBR algorithm, BRBG algorithm takes Green light into consideration to enhance the robustness of recognition. Usually, the threshold Th0 is set to a fixed value. But we find that the optimal threshold has a relationship with the proportion of clouds and sky. So the threshold will be chosen according to this proportion. 3.3 Cloud classification method based on Otsu algorithm and greyscale compensation value (GCV) Otsu algorithm is proposed by Japanese scholar Otsu. This algorithm traverses all the grey values of the image to find a threshold totsu which divides the image into two parts, the background S0 and the target S1. The principle of conventional Otsu algorithm is as follows. Suppose an image has L greyscale levels [0,1,…,L -1] and N pixels. ni is the number of pixels in greyscale level i and pi is its corresponding probability. The greyscale probability distribution is: (8) The background S0 contains pixels in greyscale level [0,…,totsu - 1] and the target S1 contains pixels in greyscale level [totsu, …,L - 1]. The probability ω0 of S0 are: (9) The probability ω1 of S1 are: (10) The average greyscale value of the two parts is represented by variable u0 and u1. (11) (12) The average greyscale value u of the whole image is: (13) So the variance between the two parts is represented by variable σtotsu. (14) Find the maximum value σtotsu, and its corresponding totsu is the optimal threshold of the Otsu algorithm which can make a biggest difference between background S0 and the target S1. This algorithm is suitable for segmenting images whose greyscale histograms have two peaks. However, some misclassifications exist due to the imbalance of image brightness distribution. The sun always makes its surrounding area brighter than other areas. When classifying clouds by brightness or greyscale value, those which are near the sun are more likely to be mistakenly identified as thin clouds. One way to solve this problem is to add a greyscale compensation term for each pixel in images. This paper proposes a compensation algorithm that extracts the greyscale compensation values (GCVs) from past clear-sky TSIs. Parameters are signed in Fig. 4. Fig. 4Open in figure viewerPowerPoint Schematic diagram of extracting GCV GCV is defined as: (15) The parameter tr is a threshold to ensure that the overall greyscale of the sample TSI remains unchanged after obtaining compensation. tr can be defined as: (16) C (r) represents the average greyscale value of all pixels at distance r from the centre of the sun in clear-sky TSI which is defined as follows. (17) where (18) (19) (20) n is the number of pixels on the circle where (xs, ys) is the centre. m is the number of all pixels. G (xi, yi) is the greyscale value of a pixel on the coordinates (xi, yi). is the average greyscale value of all pixels. The range of C (r), G (xi, yi) and are all from 0 to 1. 4 Results and analysis We divide TSIs into five categories based on cloudiness: no cloud, less cloud, medium cloud, much cloud and full cloud. Then we choose one TSI from each category as samples to test if the proposed method can be applied to multiple conditions. Five TSIs which were taken from May 29, 2017 to June 1, 2017 are selected. The pre-processed images are shown in line 1 of Fig. 5. Red dots represent the position of the sun at that moment. The results of cloud recognition and classification are shown as follows. (1) Cloud recognition Fig. 5Open in figure viewerPowerPoint This is the results of the proposed method. The number 1–5 indicates that the image belongs to five categories: no cloud, less cloud, medium cloud, much cloud and full cloud. The letter (a) indicates the result of sun positioning. The letter (b) indicates the result of cloud recognition based on the BRBG algorithm. The letter (c) indicates the result of cloud classification based on conventional Otsu algorithm. The letter (d) indicates the result of cloud classification based on improved Otsu algorithm In line 2 of Fig. 5, the result of cloud recognition based on the BRBG algorithm is displayed. We compare the accuracy with a fixed RBR algorithm in Table 2. The fixed RBR threshold is set as 0.76. The statistics show the BRBG algorithm is better and can adapt to different cloud conditions. However, some areas still cannot be correctly identified due to the impact of aerosol particles and broken clouds are more difficult to recognise, which can be seen in Fig. 5. 2(b) and Fig. 5. 3(b). (2) GCVs extraction In theory, when the clear-sky TSI and the sample are taken at the same time on neighbouring dates, the compensation effect is the best. However, it is difficult to achieve in practice. So we choose a clear-sky TSI which is taken at a different time on neighbouring dates. The calculation results of C (r) and tr are curved in Fig. 6. (3) Cloud classification The results of cloud classification based on conventional Otsu algorithm and improved Otsu algorithm with GCVs are separately presented in line 4 and 5 of Fig. 5. When using conventional Otsu algorithm, the thick clouds near the sun and thin clouds far from the sun are more easily to be misclassified. After adding the greyscale compensation term, these parts can be classified correctly. However, in much cloud and full cloud days, some thin clouds around the sun will be reclassified into thick clouds. That is because GCVs are randomly extracted from clear-sky TSIs with different date and time. Many parameters, such as the solar altitude angle, the azimuth angle and haze, will affect images' greyscale distribution. Overall, the introduction of GCVs improves the accuracy of the classification. We compare the accuracy with conventional Otsu algorithm in Table 3. Table 2. Proportion of cloud 1 2 3 4 5 BRBG (%) 0.27 29.95 62.13 84.60 100 RBR (%) 1.22 27.72 64.34 83.05 100 Fig. 6Open in figure viewerPowerPoint C(r) curve Table 3. Proportion of thin cloud and thick cloud Cloud type 1 2 3 4 5 GCV thin 0.25 18.07 29.96 34.60 34.67 (%) thick 0.02 11.26 32.17 50.00 65.33 Otsu thin 0.02 8.39 27.64 34.58 40.92 (%) thick 0.25 21.56 34.49 50.03 59.08 5 Conclusion This paper focuses on using TSIs to recognise and classifies cloud for PV power prediction. A novel cloud classification method based on Otsu and greyscale compensation algorithm is proposed. This method contains three steps. The first step is to divide the pre-processed images into two parts: clear sky and cloud, based on the BRBG algorithm. The second step is to compensate for the greyscale value of the image. The GCVs are extracted from a clear-sky TSI. The third step is to divide the cloud into thin cloud and thick cloud by using the Otsu algorithm. Compared with the Otsu algorithm without using GCV, in the proposed method the classification of clouds around the sun is more accurate, which will help improve the ability of ultra-short-term PV output prediction. 6 Acknowledgments This work is supported by National Key R&D Program of China (2017YFB0902000), Science and Technology Project of State Grid (SGXJ0000KXJS1700841), Key Research and Development Plan of Zhejiang Province (2017C01039). 7 References 1Schmidt T., Lorenz H.: 'Evaluating the spatio-temporal performance of sky-imager-based solar irradiance analysis and forecasts', Atmos. Chem. Phys., 2016, 15, (19), pp. 26997 – 27039 2Li Z., Rahman S.M., Vega R. et al.: 'A hierarchical approach using machine learning methods in solar photovoltaic energy production forecasting', Energies, 2016, 9, (1), pp. 55 – 67 3Marquez R., Pedro H.T.C., Coimbra C.F.M.: 'Hybrid solar forecasting method uses satellite imaging and ground telemetry as inputs to ANNs', Sol. Energy, 2013, 92, (4), pp. 176 – 188 4Reikard G.: 'Predicting solar radiation at high resolutions: A comparison of time series forecasts', Sol. Energy, 2009, 83, (3), pp. 342 – 349 5Yadav A.K., Chandel S.S.: 'Solar radiation prediction using artificial neural network techniques: A review', Renew. Sust. Energy Rev. 33, 2014, 2, pp. 772 – 781 6Ghonima M.S., Urquhart B., Chow C.W. et al.: 'A method for cloud detection and opacity classification based on ground-based sky imagery', Atmos. Meas. Tech., 2012, 5, (11), pp. 4535 – 4569 7Long C N., Sabburg J M., Calbó J.: 'Pagès D 'retrieving cloud characteristics from ground-based daytime color All-Sky images'', J. Atmos. Ocean. Technol., 2006, 23, (5), pp. 633 – 652 8Souzaecher M.P., Pereira E.B., Bins L.S. et al.: 'A simple method for the assessment of the cloud cover state in high-latitude regions by a ground-based digital camera', J. Atmos. Ocean. Technol., 2006, 23, (23), p. 437 9Li H., Wang F., Ren H. et al.: 'Cloud identification model for sky images based on Otsu', Int. Conf. Renew. Power Gener. IET, 2016, 5, (5), pp. 1 – 5 10Li Q., Lu W., Yang J.: 'A hybrid thresholding algorithm for cloud detection on ground-based color images', J. Atmos. Ocean. Technol., 2011, 28, (10), pp. 1286 – 1296 11Saleh M., Meek L., Masoum M.A.S. et al.: 'Battery-Less short-term smoothing of photovoltaic generation using Sky camera', IEEE Trans. Ind. Inf., 2018, 14, (2), pp. 403 – 414 Citing Literature Volume2019, Issue18July 2019Pages 4922-4926 FiguresReferencesRelatedInformation