Content uploaded by Nicola Piovesan

Author content

All content in this area was uploaded by Nicola Piovesan on Jul 06, 2018

Content may be subject to copyright.

Unsupervised Learning of Representations

from Solar Energy Data

Nicola Piovesan, Paolo Dini

CTTC/CERCA, Av. Carl Friedrich Gauss, 7, 08860, Castelldefels, Barcelona, Spain

{npiovesan, pdini}@cttc.es

Abstract—In this paper, we propose an unsupervised

method to learn hidden features of the solar energy

generation from a PV system that may give a more

accurate characterization of the process. In a ﬁrst step,

solar radiation data is converted into instantaneous solar

power through a detailed source model. Then, two different

approaches, namely PCA and autoencoder, are used to

extract meaningful features from the traces of the solar

energy generation. We interpret the latent variables char-

acterizing the solar energy generation process by analyzing

the similarities of 67 cities in Europe, North-Africa and

Middle-East through an agglomerative hierarchical clus-

tering algorithm. This analysis provides also a comparison

between the feature extraction capabilities of the PCA and

the autoencoder.

Index Terms—Energy sustainability, neural networks,

PCA, solar energy, unsupervised learning

I. INTRODUCTION

In recent years, several articles have shown that the

energy consumption of ICT may represent a problem

in terms of sustainability. In a report of 2013, the

Digital Power group [1] has calculated that 10% of the

worldwide electricity generation is due to ICT, which

is exceeded by more than 50% by that of the avionic

industry. A forecast for 2030 estimates that 51% of the

electricity consumption and 23% of the carbon footprint

by human activity will be due to ICT [2]. This trend

is mainly driven by new infrastructure deployments to

provide mobile services.

The introduction of renewable energy sources is today

one of the most promising approaches to reduce the

greenhouse gases emissions due to the human activities.

In particular, the reduced cost of the harvesting devices,

e.g., Photovoltaic (PV) systems, makes solar energy one

of the most interesting sources among the renewables.

Several works in the literature [3], [4], [5] discuss the

integration of solar energy sources into communication

networks as a way to reduce their energy consumption

and conclude that such an integration is feasible only

with the introduction of an intelligent control system

able to manage the intermittent and erratic energy budget

from renewable sources.

One of the key factor determining the performance

of a PV system and its potential application to supply,

e.g. communication network devices, is the solar energy

arriving at the surface of the Earth. The exploitation of

the solar energy resource is determined by the knowl-

edge of geographical variability and time dynamics. The

geographical analysis of the availability of the primary

solar energy resource is then essential to understand

the potential implementation of PV systems for future

energy supply to a speciﬁc industrial sector. The ge-

ographical dependency and distributed nature of solar

electricity generation impose questions that require spe-

ciﬁc location-dependent answers. In fact, the harvested

energy strictly depends on the seasons of the year and

the meteorology of the given location. In [6], it has been

estimated that, in the same site, even during summer and

in good weather conditions, the harvested energy in the

peak irradiation hour can vary up to the 85%. Similarly,

considering that the solar radiation intensity and the

daylight duration vary signiﬁcantly across the months

[6], seasons have a strong impact on the amount of the

harvested energy income. Normally, this geographical

analysis is performed using solar maps, which provide

easy-understandable information. The total annual solar

electricity generation from a PV system is used to

characterize national and regional differences [7]. In

this paper, we are interested in learning hidden features

of the solar energy generation that may give a more

accurate characterization of the process beyond that

usual metric.

Recently, representation learning has received signiﬁ-

cant attention as a highly effective alternative to conven-

tional feature sets handcrafted by a domain expert [8].

These techniques have been shown to be superior to fea-

ture engineering for a plethora of tasks, including speech

recognition, music transcription, audio and video recog-

nition [9]. However, these methods suffer the big issue

of the interpretability of their results [8]. In this work,

we use unsupervised representation learning methods to

extract automatically time-dependent features from solar

electricity generation data and provide a meaningful

interpretation of the results achieved. Although machine

learning methods have been used in renewable energy

modeling, they have been adopted mainly to forecast the

next energy arrivals in a given location [10]. Instead, to

the best of our knowledge, they have not been used for

analyzing geographical differences in solar electricity

generation.

In this paper, we state the geographical analysis of

the availability of the solar energy generation from a

PV system as an unsupervised learning problem due to

the lack of ground truth for the considered scenario.

In detail, raw data from a real database describing the

solar irradiance on a plane surface in 67 different cities

are processed to obtain estimations of the instantaneous

solar energy generation. We introduce an astronomical

model that allows estimating the actual solar electricity

generation by a PV system. Then, an electrical model of

the PV module and of the DC/DC power processor are

used to provide the ﬁnal estimation. Feature extraction is

performed on the solar electricity generation data using

two different approaches: Principal Component Anal-

ysis (PCA) and Under-complete AutoEncoder (UAE).

PCA is a non-parametric technique that learns a linear

transformation of the input data, whereas UAE is a

speciﬁc artiﬁcial neural network architecture that learns

the parameters of an encoder and a decoder function

minimizing the reconstruction error of the input space.

Then, we interpret the latent variables characterizing

the solar energy generation process by analyzing the

similarities of the different cities with an agglomerative

hierarchical clustering algorithm. This analysis provides

also a comparison between the feature extraction capa-

bilities of PCA and UAE.

The paper is organized as follows. In Section II we

provide a description of the solar irradiance dataset.

In Section III we describe the system model used to

calculate the solar electricity from a PV system; whereas

in Section IV we introduce the features extraction algo-

rithms. Section V discusses the classiﬁcation performed

by the agglomerative hierarchical clustering algorithm

and gives an interpretation of the extracted features from

the solar energy generation data. Finally, in Section VI

we draw our conclusions.

II. DATASE T

The solar irradiance dataset considered in this

work [11], contains hourly solar irradiance values,

in W/m2, collected from February 1st, 2004 to

December 31st, 2006. In particular, we consider 67 dif-

ferent cities, located in Europe, Middle East, and North

Africa.

The solar electricity generation is estimated using the

model described in Section III. In particular, the model

parameters are set considering a Panasonic N235B PV

module, which has single cell efﬁciencies of about 21%,

delivering about 186 W/m2. Each module is composed

of an array of 16 ×16 solar cells (i.e., a surface of

4.48 m2). We consider this particular dimension since

it represents a realistic size for supplying renewable

powered small base stations [12].

We deﬁne D={Dy1,...,DyK}as the dataset

containing the traces of generated energy, with K= 67.

In particular, for each city y, we have a set Dy=

Power

Processor

Iun

Ie

iout

MPMP

Fig. 1. Source model used to characterize the solar energy generation

process.

{e1,...,en}containing ndaily traces of the generated

energy ei,i∈ {1, . . . , n}. The vector eihas 24

elements, each one containing the amount of energy

generated in the respective hour of the day. Since our

dataset contains 35 months of measurements, n= 1069.

III. SYS TE M MO DE L

In this section, we describe the source model used

to characterize the electricity generated by a PV panel.

The key building blocks of the model are illustrated in

Fig. 1 and they are the solar source, the photovoltaic

panel and the DC/DC power processor.

A. Astronomical model

We deﬁne the effective solar irradiance that hits a

photovoltaic panel as Ieﬀ. This term depends on several

factors, e.g., the inclination of the panel, the geograph-

ical location, the hour of the day and the day of the

year.

In order to translate the solar irradiance, Isun, into

effective solar irradiance, Ieﬀ, we consider the following

astronomical model. According to [13], the effective

solar irradiance, Ieﬀ is proportional to cos Θ, where

Θ∈[0,90◦]is the angle between the sunlight and

the normal to the solar module surface. It can be

computed as a function of time tby Ieﬀ (t, N ) =

Isun(t, N ) max(0,cos Θ(t, N )), where Nis the day

number in a year (i.e., N= 1 for January 1st and

N= 365 for December 31st).

The value of cos Θ is calculated as:

cosΘ(t, N ) = sinγ(N)·sin La ·cos β−(1)

−sin γ(N)·cos La ·sin β·cos α+

+ cos γ(N)·cos La ·cos β·cos ω(t, N )+

+ cos γ(N)·sin La ·sin β·cos α·cos ω(t, N )+

+ cos γ(N)·sin β·sin α·sin ω(t, N )

where:

•La ∈[0,90◦]is the location latitude;

•Lo is the location longitude;

•γis the declination angle;

•ω(t, N )∈[0,360◦]is the hour angle;

•βis the inclination of the solar panel towards the

sun on the horizon;

•αis the azimuthal displacement, which takes values

different from zero if the normal to the plane of

the solar panel is not aligned with the plane of the

corresponding meridian i.e., the solar panel faces

East (α < 0) or West (α > 0).

The declination angle γis due to the elliptic orbit

of the Earth around the sun and the fact the Earth is

tilted on itself at an angle of 23.45◦. It is deﬁned as the

angular distance North or South of the Earth’s equator

and it can be calculated as:

γ(N)'sin−1[sin (23.45◦) sin (D(N))] (2)

where D(N) = 360 (N−81) /365◦.

The hour angle ωis deﬁned as the azimuth’s angle of

the sun’s rays due to the Earth’s rotation and it can be

calculated as:

ω(t, N ) = 15 (AST (t, N )−12)◦(3)

where AST(t, N )∈[0,24] hour is the apparent solar

time. We can calculate it as:

AST (t, N ) = t0+ ∆t+ ET(N)(4)

where t0is the local standard time adjusted to account

for the daylight saving time. ∆tis the time displace-

ment between the selected time zone and the time at

the reference Greenwich meridian. It is computed as

∆t= (Lo−GMA)/15◦where GM A =U T Coﬀ ×15◦

is the Greenwich meridian angle and corresponds to

the angle between the Greenwich meridian and the

meridian of the selected time zone. U T Coﬀ is the time

offset between Greenwich and the time zone whereas

15 is the rotation angle of the Earth per hour. Fi-

nally, ET (N)'[9.87 sin(2D(N))−7.53 cos(D(N))−

1.5 sin(D(N))]/60 is known as the equation of time.

B. Solar panel model

We consider a solar panel composed of nsc solar cells

connected together. A number npof them are connected

in parallel, whereas nsare connected in series. Thus,

nsc =npns.

The composition of the I-V curves of the solar cells

allows obtaining the I-V curve used to characterize the

solar panel. The I-V curve of a solar cell is given by the

superposition of the current generated by the solar cell

diode in the dark with the current due to the sunlight

hitting the cell, deﬁned as light-generated current il. We

can approximate this curve as:

iout 'il−iohexp qv

nkT −1i(5)

where qis the elementary charge, vis the cell voltage,

kis the Boltzmann’s constant, Tis the temperature in

Kelvin degrees, n≥1is the diode ideal factor. Finally,

iois the dark saturation current and corresponds to the

diode leakage current when there is not light. It depends

on the area and the technology of the solar cell.

We deﬁne isc as the short circuit current, which

corresponds to the maximum current for the cell. We

can normalize the effective irradiance, Ieﬀ with respect

to the maximum radiation of 1 kW/m2, obtaining the

radiation rate F(t, N )=0.001·Ieﬀ (t, N). Then, we can

compute the light-generated current for a single solar

cells as il(t, N ) = iscF(t, N )and obtain iout(t, N )for

a single solar cells using equation (5). Finally, the total

current generated by the solar module is iM

out(t, N ) =

npiout(t, N ).

C. Power processor model

Every voltage or current source has a maximum

power point, at which the average power delivered to

its load is maximized. In general, the load of a device

does not match the optimal one, required to extract

the maximum power from the solar source. To solve

this problem, a power processor is used to emulate the

optimal load by adjusting the source voltage until the

power extracted from it is maximized.

In this paper, in order to account for the DC/DC

power processor, we have computed the operating point

(iM

out, vM)for which the extracted power P=iM

outvM

is maximized.

We have obtained the maximum power PMP as:

PMP =ηmax

viM

out, vM=η·npnsmax

v{ioutv}(6)

where iout is given by equation (5) and η∈(0,1) is

the power processor conversion efﬁciency.

IV. FEATURE EXTRA CT ION

Two different approaches have been used to reduce

the dimensionality of the input data and extract mean-

ingful features: PCA and UAE, described in the follow-

ing sub-sections.

A. Principal Component Analysis (PCA)

PCA is a non-parametric technique for extracting

relevant features from a dataset. The purpose is to reduce

the dimensionality of the dataset by ﬁnding a new set of

variables, smaller than the original, that retains most of

the original information. Those new variables are called

principal components (PC). They are uncorrelated and

they are ordered by the fraction of the total information

each retains [14].

Given nobservations of the vector e= (e1, . . . , e24 ),

the ﬁrst PC is computed as:

z1≡aT

1e=

24

X

i=1

ai,1ei(7)

where a1= (a1,1, a2,1, . . . , a24,1)is the vector that

maximize the variance of z1.

In a similar way, the kth PC (with k= 1,...,24) is

computed as:

zk≡aT

ke(8)

i1

i2

i23

i24

...

h1

h2

o1

o2

o23

o24

...

Input

layer

Feature

layer

Output

layer

Fig. 2. Autoencoder topology used for extracting features of the solar

energy generation of the 67 cities in the dataset.

where the vector akis chosen such that the variance of

zkis maximum, subject to cov[zk, zl]=0for k > l ≥1

and aT

kak= 1.

The generic observation eican be written as the sum

of its PCs:

ei=

24

X

k=1

zi,kak(9)

According to the given deﬁnitions, it can be easily

proved that the ﬁrst PC retains the greatest amount of

variation in the sample, whereas the kth PC, zk, retains

the greatest kth fraction of the variation in the sample.

This fact allows us to approximate each observation by

truncating the sum at the ﬁrst m < 24 PCs:

ei'em

i=

m

X

k=1

zi,kak(10)

The number of considered PCs has been set to m= 2

since tests performed on the available data shows that

the ﬁrst 2 PCs retains the 94% of the information

(respectively the 79% and the 15% for the 1st and the

2nd PC). Thus, we can associate to each observation

eia feature vector hPCA

i= [zi,1, zi,2]. In this way,

for each Dy, we obtain a set of 2-dimensional features

Fy

PCA ={hPCA

1,...,hPCA

n}, which is a compressed

representation of the evolution of the solar energy gen-

eration in the city y.

B. Under-complete Autoencoder (UAE)

An under-complete autoencoder (UAE) is an artiﬁ-

cial neural network used for unsupervised learning of

representations from a set of data, for the purpose of

dimensionality reduction [15]. It learns to compress data

from the input layer into a short code, and then uncom-

press that code into something that closely matches the

original data (output layer). The set of hidden layers with

decreasing number of neurons till reaching the central

layer is called encoder. Another set of hidden layers

from the central layer to the output layer is for the

reconstruction of the original data and named decoder.

Figure 2 shows the autoencoder used in this work.

The input and output layers are composed of 24 neurons,

Fig. 3. Clusters obtained by using the PCA approach.

each one representing the amount of energy generated

in the corresponding hour of the day. The single hidden

layer, named feature layer, is composed of 2 neurons. In

this way, the information about the 24-hour solar energy

generation trace is coded into a feature of dimension 2.

We consider the Multilayer Perceptron as basic archi-

tecture, consisting of multiple fully connected layers of

neurons. The output of a neuron is computed using the

following equation:

output =f X

i

(xi·wi+bi)!(11)

where xis the input of the neuron, wis the weight of

the connection to the neuron, bis the bias and fis the

activation function. The neurons of the input and feature

layers use the ReLU as activation function (fa(x) =

max(0, x)), whereas the neurons of the output layer use

the sigmoid function (fb(x)=1/(1 + e−x)).

The dataset Dis split into two portions: the training

set T, containing nt= 730 daily traces and the valida-

tion set Vcontaining the remaining n−ntdaily traces.

The ﬁrst set is used for training the autoencoder. During

this phase, the backpropagation algorithm iteratively

updates the weights of the connections between neurons

to minimize the reconstruction loss (training loss). At the

same time, the autoencoder is used to reconstruct the

traces contained in the validation set. The validation set

provides an unbiased evaluation of the model ﬁt on the

training set (validation loss). The training and validation

losses decrease with the number of epochs (i.e., training

events) and they both converge to 10−3in 80 epochs.

After training, for each Dy, the encoder computes a set

of 2-dimensional features Fy

UAE ={hUAE

1,...,hUAE

n}.

V. CLUSTERING AND RES ULT DISCUSSION

We deﬁne the Centroid of the city y as the centroid

of the features of the city y, computed as:

cy

PCA,UAE =Pn

i=1 hPCA,UAE

i

n(12)

Fig. 4. Clusters obtained by using the UAE approach.

where the value of the centroid depends on the approach

used to extract the features (i.e., PCA or UAE).

A distance-based clustering named agglomerative hi-

erarchical clustering algorithm [16] is applied to the cen-

troids to group the cities according to their similarities.

The similarity between cities is expressed as the distance

between their centroids.

The number of clusters has been selected by perform-

ing the silhouette analysis [17]. This technique provides

a measure of similarity of an object in its own cluster

compared to other clusters. The silhouette value ranges

in the interval [-1,1], being the highest value the best

match of the object in the cluster and the smallest

the poorest. The conﬁguration is appropriate if most of

the objects have a high value. Otherwise, the cluster

conﬁguration may have too many or too few classes.

We have set the clustering algorithm to ﬁnd the number

of clusters that maximize the average silhouette value

and we obtained 2 clusters in the case of PCA and 5

clusters in the case of UAE.

The result of the clustering based on PCA feature

centroids is shown in Fig. 3, whereas the map obtained

using UAE is reported in Fig. 4. Moreover, we show

the average hourly solar energy generated for each

cluster obtained with PCA and UAE in Fig. 5 and

Fig. 6, respectively. The analysis of such variable for

each cluster drives our interpretation of the extracted

features to a more understandable model. In fact, we

can distinguish four different parameters characterizing

each identiﬁed cluster, namely: average daily generated

energy EH, solar energy peak value Pv, solar energy

peak hour Phand average daylight time D. The values

of those parameters are reported in Table I and Table II

for PCA and UAE, respectively.

The map obtained with PCA is divided into two

clusters (Fig. 3). The ﬁrst cluster covers the North-East

area and is characterized by a low amount of energy

generation (lower Ehand Pv). The second cluster covers

the South-West area and is characterized by higher solar

TABLE I

STATIST IC S OF TH E CL UST ER S OBTA INE D ON F EATUR ES

EXTRACTED WITH PCA

Cluster Ph[hr] Pv[kWh] Eh[kWh] D[hrs]

1 11 0.4 2.1 12

2 12 0.6 3.2 12

TABLE II

STATIST IC S OF TH E CL UST ER S OBTA INE D ON F EATUR ES

EXTRACTED WITH UAE

Cluster Ph[hr] Pv[kWh] Eh[kWh] D[hrs]

1 12 0.6 3.1 12

2 11 0.3 1.8 13

3 11 0.5 2.5 11

4 12 0.3 1.9 13

5 10 0.6 2.9 11

energy generation. Note that the two clusters differ also

for the peak hours Ph. On the other hand, from the

map obtained by UAE (Fig. 4), we see that the North of

Europe is divided into two parts (clusters 2 and 4). Those

clusters have the same values of Pv,D, similar Eh, but

they differ in terms of solar peak hour Ph. The south

area is divided into three clusters (1, 3 and 5). Those

clusters are very similar in terms of peak energy value

Ph, but they differ for peak hour Ph, average energy Eh

and daylight hours D.

Note that the parameter Ehrepresents the variable

used by common solar maps to discriminate the different

locations. In fact, those maps are usually based on the

average or annual amount of solar energy generation.

Therefore, PCA and UAE are able to extract two and

three new variables featuring the solar energy generation

process, respectively. The difference on the number of

extracted latent variables may be due to the non-linear

activation functions of the autoencoder, which obtains a

better projection of the input data into the feature space

compared to the linear PCA.

The geographical representation described in this pa-

per is based on the characterization of several different

temporal behaviors of the solar energy generation in

diverse geographical locations. In particular, we believe

that it may be helpful in designing energy management

systems that have to control industrial processes, which

are strictly related to the human activity. In fact, the

parameters identiﬁed by our analysis provide a direct

relation between the solar energy generation process and

the time of the day.

VI. CONCLUSIONS

In this paper, we have proposed an unsupervised

method to learn hidden features of the solar energy

generation from a PV system that may give a more accu-

rate characterization of the process. In a ﬁrst step, solar

radiation data has been converted into instantaneous

solar power through a detailed source model. Then,

Fig. 5. Average hourly solar energy generation of the clusters obtained by using the PCA approach. The shaded area represents the standard

deviation with respect to the other cities in the cluster.

Fig. 6. Average hourly solar energy generation of the clusters obtained by using the UAE approach. The shaded area represents the standard

deviation with respect to the other cities in the cluster.

two different approaches, namely PCA and autoencoder,

have been used to extract meaningful features from the

traces of the solar energy generation in an unsupervised

manner. A hierarchical clustering algorithm has been

used to group the locations according to their similar-

ities in terms of solar energy generation. The results

show that clustering on the extracted features provides

support for learning latent variables of the solar energy

generation process that may be used for a more detailed

characterization of different geographical locations.

ACKNOWLEDGMENT

This work has received funding from the Euro-

pean Union Horizon 2020 research and innovation

programme under the Marie Sklodowska-Curie grant

agreement No 675891 (SCAVENGE) and by the Span-

ish Government under project TEC2017-88373-R (5G-

REFINE).

REFERENCES

[1] M. P. Mills, “The cloud begins with coal: Big data, big networks,

big infrastructure, and big power,” Digital Power Group, August

2013.

[2] A. S. Andrae and T. Edler, “On global electricity usage of

communication technology: trends to 2030,” MDPI Challenges,

vol. 6, no. 1, pp. 117–157, April 2015.

[3] T. Han and N. Ansari, “Powering mobile networks with green

energy,” IEEE Wireless Communications, vol. 21, no. 1, pp. 90–

96, February 2014.

[4] G. Piro, M. Miozzo, G. Forte, N. Baldo, L. A. Grieco, G. Boggia,

and P. Dini, “HetNets Powered by Renewable Energy Sources:

Sustainable Next-Generation Cellular Networks,” IEEE Internet

Computing, vol. 17, no. 1, pp. 32–39, January 2013.

[5] N. Piovesan, A. F. Gambin, M. Miozzo, M. Rossi, and P. Dini,

“Energy sustainable paradigms and methods for future mobile

networks: A survey,” Computer Communications, vol. 119, pp.

101 – 117, 2018.

[6] M. Miozzo, D. Zordan, P. Dini, and M. Rossi, “Solarstat: Mod-

eling photovoltaic sources through stochastic markov processes,”

in Energy Conference (ENERGYCON), 2014 IEEE International.

IEEE, 2014, pp. 688–695.

[7] M. ri, T. A. Huld, E. D. Dunlop, and H. A. Ossenbrink, “Potential

of solar electricity generation in the european union member

states and candidate countries,” Solar Energy, vol. 81, no. 10,

pp. 1295 – 1305, 2007.

[8] Y. Bengio, A. Courville, and P. Vincent, “Representation learn-

ing: A review and new perspectives,” IEEE Transactions on

Pattern Analysis and Machine Intelligence, vol. 35, no. 8, pp.

1798–1828, Aug 2013.

[9] M. Freitag, S. Amiriparian, S. Pugachevskiy, N. Cummins, and

B. Schuller, “audeep: Unsupervised learning of representations

from audio with deep recurrent neural networks,” arXiv preprint

arXiv:1712.04382, 2017.

[10] A. K. Yadav and S. Chandel, “Solar radiation prediction using

artiﬁcial neural network techniques: A review,” Renewable and

Sustainable Energy Reviews, vol. 33, pp. 772 – 781, 2014.

[11] SoDa. Solar radiation data. [Online]. Available: http://www.soda-

pro.com/web-services/radiation/helioclim-3-archives-for-free

[12] N. Piovesan and P. Dini, “Optimal direct load control of renew-

able powered small cells: A shortest path approach,” Internet

Technology Letters, vol. 1, no. 1, p. e7.

[13] J. V. Dave, P. Halpern, and H. J. Myers, “Computation of inci-

dent solar energy,” IBM Journal of Research and Development,

vol. 19, no. 6, pp. 539–549, Nov 1975.

[14] I. T. Jolliffe, Principal components in regression analysis.

Springer, 2002.

[15] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning.

MIT Press, 2016.

[16] B. S. Everitt, S. Landau, M. Leese, and D. Stahl, Hierarchical

Clustering. Wiley-Blackwell, 2011, ch. 4, pp. 71–110.

[17] P. J. Rousseeuw, “Silhouettes: a graphical aid to the interpretation

and validation of cluster analysis,” Journal of computational and

applied mathematics, vol. 20, pp. 53–65, 1987.