MSE versus neurons in the hidden layer for static neural network.

## Abstract

The human brain, like every vital organ, is constituted of neurons. It is through this organ that we can learn and reason, reflect and memorize. The geniality of human brain and more particularly of its neurons motivates several researchers to interest to this research and to benefit from its biological aspect. The idea was to reproduce, in an artificial way, the behaviors observed in man. It was in 1943 that the first artificial neural network (ANN) was created by Warren McCulloch and Walter Pitts. It is a simple elementary processor imitating the structure and the functioning from the biological neuron. Artificial neural network is characterized by its capacity to learning and generalizing. It represents a very powerful tool. It provided multiple solutions to different complex problems. In these recent years, its effectiveness is proved in various researches fields. ANN is subdivided on two main groups, the static and dynamic neural network. The choice of the one or the other neural network type depends to the application to be processed and the complexity of model. For static neural network, information propagates in a single direction, layer by layer, and from the inlet to the outlet. They are generally used in various applications such as classifications, pattern recognition, and functions approximation. For the dynamic neural network dynamic neural network is not limited. Each neuron can send and receive information from all other neurons. The dynamic neural network architecture includes frequently one or more cycles which necessarily contain at least one delay connection. This gives rise to the dynamism notion. This neural network type is more complex than the static one, but it is more efficient for some particular applications such as dynamic modeling, monitoring, and process control. In this chapter, nonlinear autoregressive models with exogenous input (NARX) model, as type of dynamic neural network, will be used to the solar radiation prediction. Simulation results will be presented to prove the effectiveness of this model compared to those obtained using the static one.

### Keywords

- static neural network
- NARX model
- solar radiation prediction

## 1. Introduction

The human brain, like every vital organ, is constituted of a set of cells which are called neurons. It is through this organ that we can learn and reason, reflect and memorize. The geniality of human brain and more particularly of its neurons motivates several researchers to interest to this research and to benefit from its biological aspect. The idea was to reproduce, in an artificial way, the behaviors observed in man. It was in 1943 that the first artificial neural network was created by Warren McCulloch and Walter Pitts. It is a simple elementary processor imitating the structure and the functioning from the biological neuron. Artificial neural network is characterized by its capacity of learning and generalizing. It represents a very powerful tool; it provided multiple solutions to different complex problems. In these recent years, its effectiveness is proved in various researches fields. Artificial neural network are subdivided on two main groups, the static and dynamic neural network. The choice of the one or the other neural network type depends on the application to be processed and the complexity of model. For static neural network, information propagates in a single direction, layer by layer, and from the inlet to the outlet. They are generally used in various applications such as classifications, pattern recognition, and functions approximation. The connectivity between neurons in dynamic neural network is not limited. Each neuron can send and receive information from all other neurons. The dynamic neural network architecture includes frequently one or more cycles which necessarily contain at least one delay connection. This gives rise to the dynamism notion. This neural network type is more complex than the static one, but it is more efficient for some particular applications such as dynamic modeling, monitoring, and process control. In this chapter, nonlinear autoregressive models with exogenous input (NARX) model, as type of dynamic neural network, will be used to the solar radiation prediction. Simulation results will be presented to prove the effectiveness of this model compared to the static one.

## 2. Static neural network

Static neural network was the first and simplest type. It is a nonlooped network since it does not contain a feedback or delay connection [1]. It is a statistical regression tool which allows the approximation of any nonlinear function sufficiently regular. The neural architecture of this network is presented as shown in Figure 1 . It imitates the structure of the biological neuron. It is composed of a set of layers. The hidden one allows to receive a variable number of inputs, and information is moved only from inputs directly through hidden layer to the output layer without cycles or loops. Each connection is associated with a synaptic weight w, which represents the strength of each connection. The negative weight inhibits its input, while the positive weight accentuates it.

## 3. NARX model

NARX model is the abbreviation of “nonlinear autoregressive models with exogenous input”. It is registered under recurrent dynamic neural networks. It is a nonlinear autoregressive model with exogenous inputs. NARX consists of a linear ARX model with two delays, one for input and the other for output. It is based on the multilayer perceptron and the recurring connections. Its effectiveness has been proven in the research work presented in [2] to predict the PV power. It is also used in other applications such as the electricity prices prediction and the air pollution prediction [3, 4, 5]. This model is commonly used for the time series, estimation, and prediction as well as for nonlinear dynamic systems modeling. Compared to other neural network types, NARX model is characterized by a good learning, fast convergence, and better generalization [6]. The PV power prediction results presented in [2] have proven an improvement performance when using NARX model compared to those obtained using the static neural network. NARX model performances are also compared to those of static neural network and radial neural network in the research works presented in [7]. NARX gave also the best prediction results in these studies.

## 4. NARX model architecture

NARX model defines the output as a function of its inputs and its past outputs as described in the following equation [8],

Where u represents the exogenous data and y are the NARX model outputs. d_{u} and d_{y} present respectively delays order of inputs u and outputs y. Figure 2 presents the NARX model standard architecture.

For example, the NARX architecture of a neural network composed of three inputs, one output and six neurons in its hidden layer is presented as shown in the Figure 3 .

## 5. Learning and generalization

Learning and generalization are two specifics properties that characterize any neural network. Unlike traditional methods that build programs to solve a problem, neural network operates mainly on a learning basis. We do not program a neural network, but we learn it. This is why the learning phase is among the most important properties of neural network.

The learning phase consists to estimate the parameter of the network in such a way that it can best fulfill the task assigned to it. This phase cannot be effective only after having accumulated a set of inputs/outputs. When creating a neural network, the inputs and outputs are fixed relative to the application to be accomplished, it is the network weights that are modified and adjusted during the learning phase. The weight adjustment cannot be done in a random way but according to a “learning algorithm.” The generalization phase, known also the test phase, is one of the characteristics that determines the neural network performance. It consists to treat the output network with respect to the nonlearned inputs. The network generalization capacity degrades in the case of under/on learning.

## 6. Solar radiation prediction

In the present work, solar radiation will be predicted firstly with static neural network and then with NARX model. This study begins firstly with the observation of the solar radiation data base. In fact, the data base used in this work is composed of a set of solar radiation and temperature measurements correspond to an industrial company located on north of Barcelona [9]. These measurements are taken every day and every 5 minutes throughout 2010. In Figure 4 , the daily evolution of solar radiation during 2010 is presented.

As shown in the above figure, the presented database is so large. So in order to reduce this annual solar radiation descriptive curve, just the solar radiation weekly averages will be taken into consideration in the solar radiation prediction. The curve presented in Figure 4 is thus reduced as presented in Figure 5 .

## 7. Solar radiation prediction using static neural network

In this paragraph, solar radiation will be predicted using the static neural network. Inputs chosen for this neural network are the temperature and the output will be the radiation as presented in Figure 6 .

To determine the optimal neural structure for this network, the learning and test performances are treated for different neurons in the hidden layer. The transfer functions chosen for the hidden layer and for the output layer are respectively “tansig” and “purelin.” As presented in Table 1 , the optimal neurons number obtained for this static neural network is equal to 2. The simulation results of learning, test, and validation obtained with this structure are presented in Figure 7 .

Number of neurons | MSE |
---|---|

1 | 0.0288 |

2 | 0.0016 |

3 | 0.0140 |

4 | 0.0041 |

5 | 0.0071 |

6 | 0.0298 |

7 | 0.0043 |

8 | 0.0058 |

9 | 0.0106 |

10 | 0.0097 |

The optimal neural structure for the static neural network is thus composed of temperature (T) as input, radiation (R) as output, and one hidden layer which contains two neurons as shown in Figure 8 .

The results of solar radiations prediction with static neural network are presented in Figure 9. All inputs are normalized, so the maximum solar radiation value is equal to 1. The blue curve corresponds to the real solar radiation, and the red one corresponds to the predicted one. As shown in the figure, the predicted solar radiation follows the evolution of the real one, but there is not an approximation between the two curves. This is remarked especially when the solar radiation fluctuations are so important. To better treat these results, prediction error is presented in Figure 10 , and the different error mean square error (MSE), mean absolute error (MAE), and root mean square error (RMSE) are computed and presented in Table 2 .

Error | Performances |
---|---|

MSE | 0.0516 |

MAE | 0.2076 |

RMSE | 0.2272 |

Figure 11 shows that the prediction error is variable. It reaches a maximum value of 0.5 and a minimum value of 0.02. This is shows the performances of static neural network to predict the solar radiation for certain period of time and its weakness to predict it in other periods. The MSE value is equal to 0.0516; it is lower than MAE and RMSE. It is not considered too small, thus shows the inefficiency of the static neural network to best predict the solar radiation.

## 8. Solar radiation prediction using NARX model

In this part, solar radiation will be predicted using the NARX model. As presented in the previous paragraph, to predict a future value, NARX model is based on the historical data related to this value and involves some exogenous data. As temperature influences the solar radiation variation, it is chosen as an exogenous data. So the NARX model inputs will be the historical solar radiation data and temperature data as presented in Figure 11 .

The hidden layers number and their neurons must be chosen in such a way that they offer the best network performances in learning and in generalization. So in this paragraph, the network performances will be treated for different neural network architecture. Inputs for NARX model correspond to the historical solar radiations (R(t−1) and R(t−2)) and the ambient temperatures (T(t−1) and T(t−2)). The output will be the predicted solar radiation at time t (R(t)) as presented in Figure 12 . The transfer functions used for the hidden layer and for the output layer are respectively “tansig” and “purelin.”

First, the network performances will be studied with just one neuron in the hidden layer; then, number of neurons will be incremented and the network performances will be restudied. Network performances are treated by the compute of the mean square error of learning and test (MSE). The optimal neural structure corresponds to the one which presented the minimal MSE. Simulations results for this study are presented in Table 3 and in Figure 13 . The optimal neural architecture obtained is the one which its hidden layer contains five neurons as presented in Figure 14 .

Number of neurons | MSE |
---|---|

1 | 0.0047 |

2 | 0.0217 |

3 | 0.0122 |

4 | 0.0072 |

5 | 0.00089 |

6 | 0.0016 |

7 | 0.0076 |

8 | 0.0258 |

9 | 0.0784 |

10 | 0.0460 |

Based on this neural network, solar radiation is predicted by NARX model. Simulation results are presented in Figure 15 . The blue curve corresponds to the real solar radiation, and the red curve corresponds to the predicted one. As obtained with the static neural network, the predicted solar radiation follows the evolution of the real one. Furthermore, an approximation between the real and predicted curves is remarked, the two curves are overlapped for certain period of time especially when the solar radiation fluctuations are low. So an improvement in the quality of solar radiation prediction with NARX model is remarked compared to that obtained with the static neural network.

To the best evaluation of the NARX model performances, the solar radiation prediction error is presented in Figure 16 . The different error MSE, MAE, and RMSE are computed and presented in Table 4 . As presented in Figure 16 , the maximum error reaches the value of 0.42, and the minimum one is equal to 0. MSE is always the lowest one. It indicates a value of 0.0348. It is low compared to this one obtained with static neural network. Therefore, the performance of NARX model is proven in this work to predict the solar radiation.

Error | Performances |
---|---|

MSE | 0.0348 |

MAE | 0.1360 |

RMSE | 0.1864 |

## 9. Conclusion

In this chapter, the solar radiation is predicted using two different neural networks, the static one and the NARX model. Simulations results are presented and are proven the effectiveness of NARX model to predict the solar radiation compared to the static neural network. The efficiency of NARX model is proven especially for the low solar radiation fluctuations. The NARX model is characterized by the presence of a direct feedback of the output which has given it an additional predictive power.