Development of relative humidity models by using optimized neural network structures

Climate has always had a very important role in life on earth, as well as human activity and health. The influence of relative humidity (RH) in controlled environments (e.g. industrial processes in agro-food processing, cold storage of foods such as fruits, vegetables and meat, or controls in greenhouses) is very important. Relative humidity is a main factor in agricultural production and crop yield (due to the influence on crop water demand or the development and distribution of pests and diseases, for example). The main objective of this paper is to estimate RH [maximum (RHmax), average (RHave), and minimum (RHmin)] data in a specific area, being applied to the Region of Castilla-La Mancha (C-LM) in this case, from available data at thermo-pluviometric weather stations. In this paper Artificial neural networks (ANN) are used to generate RH considering maximum and minimum temperatures and extraterrestrial solar radiation data. Model validation and generation is based on data from the years 2000 to 2008 from 44 complete agroclimatic weather stations. Relative errors are estimated as 1) spatial errors of 11.30%, 6.80% and 10.27% and 2) temporal errors of 10.34%, 6.59% and 9.77% for RHmin, RHmax and RHave, respectively. The use of ANNs is interesting in generating climate parameters from available climate data. For determining optimal ANN structure in estimating RH values, model calibration and validation is necessary, considering spatial and temporal variability. Additional key words: artificial neural networks; climate data; limited data.


Introduction
Climate has always had a very important role in human health and lifestyle.It forms an integral part of the criteria determining the location of agricultural production sites, recreational areas, urban development, and industrial areas.The availability of data on different climatic parameters allows for characterization of regional climate, and a large amount of climate records are needed to carry out a complete study.Several studies have been based on the use of different climate data or indicators calculated from basic climatic parameters.However, these works usually presents limitations due to problems with data availability and quality (Elías and Ruiz-Beltrán, 1981;De León et al., 1988;Allen et al., 1998;Fount, 2000).
Different authors have proposed algorithms and techniques to perform data generation across several disciplines (Allen et al., 1998;Allison, 2001).Some have aimed to estimate climatic parameters, such as global radiation and reference evapotranspiration (ET 0 ), from basic climate data.However, estimation of relative humidity (RH) is less common (De la Casa et al., 2003;Singh et al., 2004;Popova et al., 2006), despite the importance of RH as a climatic factor in the agricultural sector.In fact, many plant pathologists consider RH the most important environmental factor in the development of plant diseases (Villalobos et al., 2002).RH contributes to determining final crop yield, affects stomata opening and has a direct influence on atmospheric evaporative demand (De Juan and Martín de Santa Olalla, 1993).
Artificial Neural Networks (ANN) have been used in generating various types of climate data: air temperature, RH, vapour pressure, drew point temperature, and reference evapotranspiration (Shank, 2003;Trajkovic et al., 2003;Zanetti et al., 2007).In this paper, Artificial Neural Networks are used to generate RH considering maximum and minimum temperatures and extraterrestrial solar radiation data.The main objective of this paper is to estimate RH [maximum (RH max ), average (RH ave ), and minimum (RH min )] data in the Region of Castilla-La Mancha (C-LM) from available data at thermo-pluviometric weather stations.

Material and methods
The proposed methodology can be summarized in Figure 1; the set of variables that best estimates RH Humidity models by using neural networks S163 from the data series at 44 complete weather stations is selected.An improved structure is determined by analyzing the training error and the errors in spatial and temporal validation (def ined by 10 nodes and 2,500 iterations) from a reference structure by using response surface plots.

The case study
The study location is in Castilla-La Mancha, Spain (C-LM; Fig. 2), which is a semiarid region with an area of 79,462 km 2 .In this region, 132 weather stations are available with historical time series of monthly averages, maximum and minimum temperature data (T ave , T max , and T min ) and precipitation data, which is useful in characterizing local climate.The data from these weather stations have been checked and validated using different techniques for detecting data quality (Alexanderson, 1984(Alexanderson, , 1986)).
Models to estimate RH from monthly temperature data are generated by using 44 agroclimatic weather stations with complete daily data from 2000 to 2008.These are included in the Agroclimatic Information Service for Irrigation (SIAR, «Servicio de Información Agroclimática para el Regadío») network (Fig. 2).
The basic scheme of a neuron is composed by activation and squashing functions (Figs. 3 and 4).There are several activation functions that can be used, but the most common is the weighted sum function (Eq. [1], Nabney, 2002): A squashing function provides non-linearity to the structure.The hyperbolic tangent squashing function was used in this study (Eq.[2]): [2] This squashing function follows the equation: The hidden to output layer can have different activation functions depending on the goal of the problem.The logistic or softmax, among other possible functions, can be used for classification problems.In this case, the linear activation function is used (Eq.[4], Nabney, 2002) to solve a regression problem.
[4] Thus, the result of the ANN is described by Eq. [5]: [5] In the case of regression problems, Z k = S k , and in classification problems, Z k is the result of a non-linear transformation of S k (Fig. 3).
The ANNs were trained (calibration process) under supervision using a scaled conjugate gradient algorithm (Nabney, 2002).This algorithm was selected because the multi-layer perceptron (MLP) has a non-linear structure, so training is best conducted using a general purpose, non-linear optimization method.
As stated above, an ANN structure was proposed with three layers: the input layer, the hidden layer with different numbers of hidden nodes, and the output layer, which shows the results.The input layer is composed by basic climatic data such as temperature (average, maximum, and/or minimum temperature), precipitation, and/or extraterrestrial solar radiation (Fig. 5).A total of 2,000 ANN structures were trained with monthly data from 40 of the 44 SIAR weather stations for the period 2000 to 2007 (Figs. 2 and 6).The three improved structures (for estimating RH min , RH max and RH ave ) were selected after the validation process (Fig. 1 and 6) by focusing on spatial and temporal validation.During the spatial and temporal calibration process, other data (validation data) were applied on the previously calibrated ANN structures using the training Humidity models by using neural networks S165 Hidden-output layer . . . .data.Four weather stations not used in the calibration process were used for the spatial validation.These stations are located in different areas of the region (Fig. 2) and were previously selected as representative of the different climatic zones (despite the homogeneity of thermal records, Tables 1 and 2, Fig. 2).Tables 1 and  2 present maximum and minimum temperature average values in weather stations in the Region of Castilla-La Mancha.Characterization of mean temperatures is shown graphically in Fig. 2. Table 1, which gives information on the variability detected among the 44 weather stations for monthly and annual averages corresponding to T max and T min over the period 2000-2008, uses descriptive statistical analysis (Fernández-Fernández et al., 2002).In Table 2 the average monthly and annual data of the four weather stations used for spatial validation can be observed.These data completes the temperature information for those selected stations useding the validation process.The correlation coefficient matrix between temperature data in the 44 weather stations are high (Martínez-Romero, 2010).Correlations between records from the stations is important when applying ANN techniques (Nabney, 2002).To perform temporal validation, the year 2008 was used (data from the 44 weather stations), as it was not included in the calibration process (Fig. 6).
To determine the variables (input nodes) that permit to better estimate the RH, an ANN structure with 10 hidden nodes and 2,500 iterations were used.Thus, different combinations of temperatures (T max , T min , and   T ave ), precipitation, and atmospheric solar radiation were analyzed and a set of variables that best estimates RH was selected.
After determining this «best» set of variables, an ANN structure optimization process was performed, with a main objective of minimizing estimation error.The optimization process consists of calibrating and validating ANN structures with different numbers of nodes (1 to 20) and different numbers of iterations (1 to 1,000 in a range of 10).Thus, 2,000 structures were calibrated and then validated with the above proposed methodology, resulting in 2,000 error estimates for spatial validation and 2,000 errors for temporal validation.In order to select an improved ANN structure, response surface plots were used to detect the areas with lower error, which coincides in both figures.
To maintain consistency among RH data (maximum, minimum and average), it is advisable to generate two of them by using ANN models and calculate one RH considering the other two RHs, using Eq.[6] as the relation between RHs. [6]

Goodness of fit of the ANN models
Statistical parameters were used to determine the goodness of fit of the ANN models (Willmott, 1982), such as coefficient of determination (R 2 ), root mean square error (RMSE), relative error (RE), and the similarity rate (SR).
[7] RMSE is the root mean square error, n is the number of observations, and P i and O i are the predicted and observed values, respectively.
[8] RE is the relative error, estimated as a percentage of the average value of the variable and O ave is the average value of the variable observed.
[9] SR is the similarity rate and is expressed as a relative measure of the difference between variables; if SR = 1, there is perfect agreement between P i and O i .

Results
The set of variables (thermo-pluviometric) that obtain good fit with the RH data for a structure of 10 nodes and 2,500 iterations are T max , T min , and Ra.As a first approximation, the RH min , RH max and RH ave can be estimated with training errors of 3.88%, 4.77% and 5.02%, respectively (Table 3).However, the validation errors are perceptibly higher and can be estimated with the following RMSE, respectively: 1) for spatial validation 5.06%, 6.91% and 7.04%; and 2) for temporal validation 4.68%, 5.99% and 6.31%.These errors have been obtained by contrasting ANN model results with the average monthly values estimated using the daily RH records.
Humidity models by using neural networks S167 The response surface plots show the RMSE of all ANN structures (2,000 in this case) as a function of the number of iterations and hidden nodes.As an example, Figure 7 shows the response surface plots of the spatial (Fig. 7a) and temporal (Fig. 7b) validation of the estimation of RH max , using T max , T min , and Ra as input variables.The common minimum RMSE in the estimation of RH max is obtained with a structure of more than 3 nodes and 50-250 iterations.In the error analysis shown by the 2,000 ANN structures for spatial and temporal validation, there are signs of overfeeding in the network, which increases the RMSE when the number of nodes and iterations are simultaneously increased (Fig. 7).
The structures selected for estimating RHs are: 10 hidden nodes and 410 iterations for H min (RMSE of 4.21% for spatial validation and 3.99% for temporal validation), 12 hidden nodes and 210 iterations in the estimation of RH max (RMSE of 5.84% for spatial validation and 5.69% for temporal validation), 14 nodes and 160 iterations for the estimation of RH ave (RMSE of 6.17% for spatial validation and 5.70% for temporal validation).The training errors for these three structures are 3.85%, 4.92% and 5.14% for H min , H max and H ave , respectively, values slightly below the validation errors.
Table 4 summarize the statistical parameters analyzed after estimating RH data for spatial and temporal validation from average monthly T max , T min , and Ra data using improved ANN structures.To maintain the consistency between the RH data, two should be generated using ANN models and by calculating each RH value considering the other two, which considers the relationships among RHs.Thus, RH min estimated by the improved ANN model shows better fit (R 2 = 92%) than the fit from obtaining it using the average of RH max and RH ave (R 2 = 90 and 91% for spatial and temporal validation, respectively).In addition, the relative error is doubled when RH max and RH ave are used.RH max estimation shows similar trends (Table 4).RH ave estimation using the selected ANN shows smaller differences, maintaining fit (R 2 of 82-83%) and slightly increasing the relative error (RE of 9.79% vs. 10.27% for spatial validation and RE of 8.88% vs. 9.77% for temporal validation) (Table 4).

Discussion
The availability of complete RH data series as a climate variable that directly acts on living beings is very important in various disciplines, among them    No. nodes agricultural applications (De Juan and Martín de Santa Olalla, 1993;Capel, 2000;Matsushita et al., 2004).It is considered one of the most important factors in the development of pests and diseases (Huber and Gillespie, 1992;Laurence et al., 2002), and directly influences evaporation by affecting stomata.Therefore, it has an important influence on final crop yield (Villalobos et al., 2002).RH values are necessary for applying models with a strong physiological basis for estimating ET 0 (Allen et al., 1998), including models for generating the test reference year (TRY) from measured meteorological variables (De Miguel and Bilbao, 2005).
Weather generators have been used extensively in agricultural and hydrological applications where high spatial resolution and/or long sequential series of records are required to solve common problems (Wilby and Wilks, 1999), but estimating this climate parameter when there are no records has not been studied.Missing value estimation is extremely difficult for locations with high spatial variance (Cano et al., 2004).Standard techniques for this problem use regression or interpolation models associated with neighboring stations with complete records of RH (Eischeid et al., 1995;Allen et al., 1998;Xia et al., 1999).There are climate data generators which are more complex, based on Bayesian Networks or other stochastic models, neural networks, clustering methods, canonical correlation analysis, among others.These models also require values for the variable to be estimated from nearby stations (Wilby and Wilks, 1999;Basak et al., 2004;Cano et al., 2004;Hruschka et al., 2007).
This innovative research permits to estimate RH values in this area to develop ANNs that estimate mean monthly RH values from temperature data in a specific location.Authors like Randhir et al. (2004) used ANNs to estimate surface specific humidity using microwave brightness temperature observation where the global error (RMSE) differences were 1.1 g kg -1 .The results are of application in diverse, climatebased models of dynamic simulation in plant growth (Acock, 1991), with climate as a direct influence on gross photosynthetic rate at a given time (Pereira and Machado, 1986;Dourado-Neto et al., 1998).A direct application of monthly RH data can be performed by the program ClimGen (Stöckle et al., 1999), an extension of the crop growth simulator Cropsyst.This program generates daily values from a series of monthly values for their use in simulations.
The use of an ANN structure similar to that used in other studies to estimate climatic parameters (Kifli and Öztürk, 2007;Dai et al., 2008;Kumar et al., 2008) does not guarantee good fit, as the models can be too simple or too complex to yield good results, or generate overfeeding problems.The number of hidden layers and the number of nodes in each hidden layer are usually determined by a trial-and-error procedure (Ritchie et al., 2003;Xu and Chen, 2008), and there are no rules for determining the exact number of layers or hidden nodes (Dawson and Wilby, 2001;Xiong and O'Connor, 2002).Therefore, the response surface plots are useful tools in this sense.
The results obtained in the present study are a good starting point in research on generating RH values when data is limited, which can be used in databases (metadata from weather stations) and can be made available for a variety of uses (Prohom and Herrero, 2008).
The use of ANNs is interesting in generating climate parameters from available climate data.For determining optimal ANN structure in estimating RH values, model calibration with some of the available data is necessary, and validation must be performed on the results with climatic data from stations not used in the calibration process, considering spatial and temporal variability.
It is recommended estimating RH min and RH max using the improved ANN model and estimating RH ave as the average of RH min and RH max .This maintains coherence among the three RHs.
In the Region of C-LM, the estimated environmental RH data from basic temperature and Ra data were estimated with relative errors of: 1) spatial error of 11.30%, 6.80% and 10.27% for RH min , RH max and RH ave ; 2) temporal errors of 10.34%, 6.59% and 9.77% for RH min , RH max and RH ave .
The methodology developed in this paper reduces the RE to aproximately 10% to estimate the RHs and it could be used for different purposes in future research.Thus, this methodology could be implemented in areas with lack of climatic data and could improve the process of crop water requirements forecast, as well as the management of water resources.On the other hand, in other applications, ANN models could be optimized for different frequencies in the climate records (e.g.hourly, daily, etc.), which could be interesting in agricultural or industry sector.

Figure 1 .
Figure 1.Diagram of the proposed methodology.

Figure 2 .
Figure 2. Location of the complete weather stations available and used in this study in Castilla-La Mancha (C-LM) during 2000-2008.Distribution of annual average temperature.

Figure 3 .
Figure 3. Artificial neural network structure used and associated equations., is the activation function;S j , is the variable associated with each hidden unit; w 0j , are the bias parameters associated with the hidden units; w ij , represents the elements of the first-layer weight matrix and x i , are input values to the network; y j = tanh(S j ), is the squashing function (hyperbolic tangent); y j , are the outputs of the hidden unit;, is the activation function; S k , are second layer activation values; v 0k , are bias parameters associated with the hidden units; v jk , represents the elements of the second-layer weight matrix and y i , are input values to the network; z k = f(S k ), is the output-unit activation function; Z k are output values; in regression problems, Z k = S k .

Figure 4 .
Figure 4. Scheme of a neuron.

Figure 6 .
Figure 6.Scheme of data distribution for calibration and validation.

Figure 7 .
Figure 7. Response surface plots of the evolution of the root mean square error (RMSE) based on the Artificial Neural Network structure used for estimating maximum relative humidity in Castilla-La Mancha (C-LM): a) spatial validation for 4 weather stations (time series 2000-2008), b) temporal validation for the year 2008 (44 weather stations).

Table 1 .
Statistical values for maximum and minimum temperatures of the 44 weather stations in Castilla-La Mancha region for average values in the series2000-2008.

Table 3 .
Estimation of relative humidity by using artificial neural networks (ANN) models (def ined structure by 10 nodes and 2,500 iterations) in Castilla-La Mancha (C-LM) with average maximum, and minimum monthly temperatures and extraterrestrial solar radiation data as inputs of the model max : maximum relative humidity.RH min : minimum relative humidity.RH ave : average relative humidity.RMSE: root mean square error.RE: relative error.SR: similarity rate.

Table 4 .
Estimated monthly average relative humidity in Castilla-La Mancha (C-LM) from optimized artificial neural networks (ANN) using averages of maximum and minimum temperatures and extraterrestrial solar radiation.Error of spatial an temporal validation ax: observed values.y: predicted values.R 2 : determination coeff icient.RMSE: root mean square error.RE: relative error.SR: similarity rate.RH min : minimum relative humidity.RH max : maximum relative humidity.RH ave : average relative humidity.b Each relative humidity value is estimated from the other two, generated from ANN techniques using the ratio that determines average relative humidity as the average of minimum and maximum humidity.