<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">IIM</journal-id><journal-title-group><journal-title>Intelligent Information Management</journal-title></journal-title-group><issn pub-type="epub">2160-5912</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/iim.2018.104008</article-id><article-id pub-id-type="publisher-id">IIM-85906</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  An Optimization of Neural Network Hyper-Parameter to Increase Its Performance
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Yinxuan</surname><given-names>Fu</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>Cranbrook Kingswood Schools, Bloomfield Hills, MI, USA</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>admin@embarkchina.org</email></corresp></author-notes><pub-date pub-type="epub"><day>11</day><month>07</month><year>2018</year></pub-date><volume>10</volume><issue>04</issue><fpage>99</fpage><lpage>107</lpage><history><date date-type="received"><day>31,</day>	<month>October</month>	<year>2017</year></date><date date-type="rev-recd"><day>8,</day>	<month>July</month>	<year>2018</year>	</date><date date-type="accepted"><day>11,</day>	<month>July</month>	<year>2018</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  With the boost of artificial intelligence, the study of neural network intrigues scientists. Artificial neural network, which was first designed theoretically in 1943 based on understanding of human brains, demonstrated impressing computational and learning capabilities. In this paper, we investigated the neural network’s learning capability by using a feed-forward neural network to recognize human’s digit hand-writing. Controlled experiments were executed by changing the input values of different parameters, such as learning rates and hidden layer units. After investigating upon the effects of each parameter on the overall learning performance of the neural network, we concluded that, when an intermediate value of one given parameter was implemented, the neural network achieved the highest learning efficiency, and potential problems like over-fitting would be prevented.
 
</p></abstract><kwd-group><kwd>Learning Efficiency</kwd><kwd> Neural Network</kwd><kwd> Intermediate Values</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The human brain has always intrigued scientists. The brain’s function is very powerful and efficient [<xref ref-type="bibr" rid="scirp.85906-ref1">1</xref>] . Scientists have devoted themselves for a long time to the deciphering of brain’s structure and its power. In 1943, Warren McCulloch and Walter Pitts together produced a theory on how the biological neural network might work [<xref ref-type="bibr" rid="scirp.85906-ref2">2</xref>] . The computational structure became the basis on which future development of artificial neural network (referred to as “neural network” below) was built.</p><p>The basic structure of neural network consists of large number of artificial neurons, which execute similar function as biological neurons, but in more abstract forms [<xref ref-type="bibr" rid="scirp.85906-ref3">3</xref>] . Artificial neurons (referred to as “neurons” below) are separated into three or more layers: one input layer, one or multiple hidden layer(s), and one output layer. Information and data enter from the input layer and are transmitted to hidden layer neurons, through which data are analyzed and transformed to the next layer via algorithms. To carry out its function, we must first let the neural network “learn”, just as the human brain. We train the neural network with certain information and data, and it will be able to analyze data with similar traits. However, like the human brain, neural network will “behave” differently if input data is different or if different network parameters are applied. Such parameters include learning rate (the rate at which a neural network is adapting to new information and/or data), weights (the measure of influence of one neuron to another), number of hidden layers, etc. [<xref ref-type="bibr" rid="scirp.85906-ref4">4</xref>] .</p><p>In this paper, we are investigating the effects of these parameters on the neural network. We are using a feed-forward neural network to recognize human’s digit handwriting. The dataset is the USPS collection of handwritten digits, which contains images of digits that people wrote [<xref ref-type="bibr" rid="scirp.85906-ref5">5</xref>] . The input is a 16 by 16 image of greyscale pixels, showing an image of a handwritten digit. We don’t implement any image pre-processing since it is beyond the scope of this paper; therefore, the input layer contains 256 neurons, one for each pixel. We use only one hidden layer with multiple sigmoid (logistic) neurons. We use 10 soft max neurons for the output layer, and each neuron represents one class among 0 to 9. The structure is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>.</p></sec><sec id="s2"><title>2. Optimization</title><p>In this section, we applied different learning rates to the neural network, and explored their effects on training performance by comparing the loss on the training data [<xref ref-type="bibr" rid="scirp.85906-ref6">6</xref>] . We tried learning rates of 0.002, 0.01, 0.05, 0.2, 1.0, 5.0, and 20.0, both with momentum (0.1, 0.5, and 0.9 respectively) and without momentum [<xref ref-type="bibr" rid="scirp.85906-ref7">7</xref>] . The result is shown in <xref ref-type="table" rid="table1">Table 1</xref> and depicted in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><p>The results show that for each momentum, the training loss is the lowest at either 0.2 or 1.0 learning rate, while the value is larger at very small or very large learning rate. <xref ref-type="fig" rid="fig3">Figure 3</xref> compares the behavior of the neural network at different</p><table-wrap-group id="1"><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Affect of momentums in learning rates and training loss</title></caption><table-wrap id="1_1"><caption><title> (b)</title></caption><table><tbody><thead><tr><th align="center" valign="middle"  colspan="2"  >Momentum = 0</th><th align="center" valign="middle"  colspan="2"  >Momentum = 0.1</th></tr></thead><tr><td align="center" valign="middle" >Learning rates</td><td align="center" valign="middle" >Training loss</td><td align="center" valign="middle" >Learning rates</td><td align="center" valign="middle" >Training loss</td></tr><tr><td align="center" valign="middle" >0.002</td><td align="center" valign="middle" >2.30428</td><td align="center" valign="middle" >0.002</td><td align="center" valign="middle" >2.30422</td></tr><tr><td align="center" valign="middle" >0.01</td><td align="center" valign="middle" >2.30212</td><td align="center" valign="middle" >0.01</td><td align="center" valign="middle" >2.30183</td></tr><tr><td align="center" valign="middle" >0.05</td><td align="center" valign="middle" >2.29297</td><td align="center" valign="middle" >0.05</td><td align="center" valign="middle" >2.29170</td></tr><tr><td align="center" valign="middle" >0.2</td><td align="center" valign="middle" >2.22897</td><td align="center" valign="middle" >0.2</td><td align="center" valign="middle" >2.21025</td></tr><tr><td align="center" valign="middle" >1.0</td><td align="center" valign="middle" >1.59884</td><td align="center" valign="middle" >1.0</td><td align="center" valign="middle" >1.52411</td></tr><tr><td align="center" valign="middle" >5.0</td><td align="center" valign="middle" >2.30132</td><td align="center" valign="middle" >5.0</td><td align="center" valign="middle" >2.30185</td></tr><tr><td align="center" valign="middle" >20.0</td><td align="center" valign="middle" >2.30259</td><td align="center" valign="middle" >20.0</td><td align="center" valign="middle" >2.30259</td></tr></tbody></table></table-wrap><table-wrap id="1_2"><caption><title></title></caption><table><tbody><thead><tr><th align="center" valign="middle"  colspan="2"  >Momentum = 0.5</th><th align="center" valign="middle"  colspan="2"  >Momentum = 0.9</th></tr></thead><tr><td align="center" valign="middle" >Learning rates</td><td align="center" valign="middle" >Training loss</td><td align="center" valign="middle" >Learning rates</td><td align="center" valign="middle" >Training loss</td></tr><tr><td align="center" valign="middle" >0.002</td><td align="center" valign="middle" >2.30372</td><td align="center" valign="middle" >0.002</td><td align="center" valign="middle" >2.30014</td></tr><tr><td align="center" valign="middle" >0.01</td><td align="center" valign="middle" >2.29971</td><td align="center" valign="middle" >0.01</td><td align="center" valign="middle" >2.28402</td></tr><tr><td align="center" valign="middle" >0.05</td><td align="center" valign="middle" >2.28010</td><td align="center" valign="middle" >0.05</td><td align="center" valign="middle" >2.00861</td></tr><tr><td align="center" valign="middle" >0.2</td><td align="center" valign="middle" >1.99455</td><td align="center" valign="middle" >0.2</td><td align="center" valign="middle" >1.08343</td></tr><tr><td align="center" valign="middle" >1.0</td><td align="center" valign="middle" >1.13944</td><td align="center" valign="middle" >1.0</td><td align="center" valign="middle" >2..01872</td></tr><tr><td align="center" valign="middle" >5.0</td><td align="center" valign="middle" >2.30255</td><td align="center" valign="middle" >5.0</td><td align="center" valign="middle" >2.30259</td></tr><tr><td align="center" valign="middle" >20.0</td><td align="center" valign="middle" >2.30259</td><td align="center" valign="middle" >20.0</td><td align="center" valign="middle" >2.30259</td></tr></tbody></table></table-wrap></table-wrap-group><p>momentum. We can see that the training loss value is smaller with momentum, and in our case, the value is the smallest at the biggest momentum (momentum = 0.9). Therefore, momentum is a good way to accelerate the training process. However, since the biggest momentum in our experiment is 0.9, we cannot</p><p>conclude that the behavior of the neural network with very large momentum would be better. In practice, we expect that too large momentum will also deteriorate the learning performance, which is known as “overshooting”.</p><p>The neural network converges faster if the loss on the training data is smaller at certain iterations. From the data above, we can conclude that the best learning rate at which the neural network works falls at a specific range, in our case between 0.2 and 5.0, varying due to different momentum. With extremely small learning rate values (i.e. very close to 0), it would take very long time to train the neural network. On the other hand, with extremely large learning rate values, the neural network may draw unnecessary information from the data, and thus also decrease the efficiency of the training.</p></sec><sec id="s3"><title>3. Generalization</title><p>In this step, we are trying to find a good generalization for the neural network by examining the classification loss on the validation data. We first investigate early stopping as the easiest way to improve network generalization [<xref ref-type="bibr" rid="scirp.85906-ref8">8</xref>] . As the number of iterations increases, the neural network may draw unnecessary information from the data (over-fitting) and thus generate worse results [<xref ref-type="bibr" rid="scirp.85906-ref9">9</xref>] , which make the validation loss bigger. Early-stopping is a way to increase neural network’s efficiency by choosing the model at the lowest validation loss, which will reduce the chance of over fitting. We first ran the code without early stopping. <xref ref-type="fig" rid="fig2">Figure 2</xref> shows the behavior of the neural network without early stopping. The validation data loss increased after approximately 200 iterations, which is a sign of over fitting. We then turned on early stopping. MATLAB shows that the validation loss was lowest after 161 iterations, which fitted the graph. Thus, by using early-stopping, we reduce the number of calculations by a great extent while getting better results: the validation loss was 0.43019 without early stopping and 0.33451 with early stopping.</p><p>We then ran the data with different weight decay (wd) coefficients [<xref ref-type="bibr" rid="scirp.85906-ref10">10</xref>] . The wd coefficient is a measure of preference on how simple we want our model to be. With larger value of coefficient, the neuron adds a bigger “weight” penalty to the overall loss function, and thus pushes the “weights” to be relatively smaller. The data in <xref ref-type="table" rid="table2">Table 2</xref> and <xref ref-type="fig" rid="fig4">Figure 4</xref> shows the results. <xref ref-type="fig" rid="fig5">Figure 5</xref> is a zoomed-in picture of the results where wd coefficient is in the range between 0 and 0.01.</p><p>The pattern is similar to that of learning rates. The lowest value of validation loss occurs in a specific range, in our case between wd coefficient of 0.0001 and 0.01. As wd coefficient goes toward extreme values (either close to 0 or infinity), the efficiency of the neural network decreases. This is reasonable. If a certain data is multiplied by too big or too small weight values, it would affect the overall summation by a significant degree, and thus decrease the efficiency of the neural network.</p><p>Another possible solution for overfitting is to regularize the number of hidden units [<xref ref-type="bibr" rid="scirp.85906-ref11">11</xref>] . Overfitting means that the neural network is drawing too much information from the data, many of which are necessary or unrelated. The training result of such neural network would be biased. For example, given images of 100 red apples and 10 green apples, a normal neural network may conclude that apples are round with a short stem on the top, while an overfitting neural network would see the color of red as a feature of apple and see the green apples as outliers. To reduce the possibility of overfitting, we reduce the number of hidden layer units to decrease the calculation capacity of the neural network. The results are shown in <xref ref-type="table" rid="table3">Table 3</xref> and <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><p>The data and graph demonstrate similar results as above that the best generalization occurs at a specific value, in this case, between hidden units 10 and 100. It is thus reasonable to conclude that different means of regularization would all work with the best efficiency at a certain value of that parameter.</p><p>What if we combine different ways of regularization methods? Would it generate even better results [<xref ref-type="bibr" rid="scirp.85906-ref12">12</xref>] ? Here we combined the parameter of hidden layer units with early stopping. We implemented 38 neurons for the hidden layer,</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Wd coefficient-validation loss</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Wd coefficient</th><th align="center" valign="middle" >Validation loss</th></tr></thead><tr><td align="center" valign="middle" >0</td><td align="center" valign="middle" >0.430185</td></tr><tr><td align="center" valign="middle" >0.0001</td><td align="center" valign="middle" >0.34829</td></tr><tr><td align="center" valign="middle" >0.001</td><td align="center" valign="middle" >0.28791</td></tr><tr><td align="center" valign="middle" >0.01</td><td align="center" valign="middle" >0.50976</td></tr><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >2.30259</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >2.30259</td></tr></tbody></table></table-wrap><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> Hidden layers units-validation loss</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Hidden Layers Units</th><th align="center" valign="middle" >Validation Loss</th></tr></thead><tr><td align="center" valign="middle" >10</td><td align="center" valign="middle" >0.42171</td></tr><tr><td align="center" valign="middle" >30</td><td align="center" valign="middle" >0.31708</td></tr><tr><td align="center" valign="middle" >100</td><td align="center" valign="middle" >0.36859</td></tr><tr><td align="center" valign="middle" >130</td><td align="center" valign="middle" >0.3976</td></tr><tr><td align="center" valign="middle" >200</td><td align="center" valign="middle" >0.430185</td></tr></tbody></table></table-wrap><p>which achieves the best results in above experiments. <xref ref-type="fig" rid="fig7">Figure 7</xref> shows a comparison of data with and without early stopping. The data with early stopping exhibits lower validation loss values. The absolute minimum is ever lower than that of the data without early stopping (0.28683 compared to 0.31708).</p></sec><sec id="s4"><title>4. Initialization</title><p>In this section, we first implemented Restricted Boltzmann machine (RBM) to learn the feature of USPS data in an un-supervised fashion [<xref ref-type="bibr" rid="scirp.85906-ref13">13</xref>] . Then, we transfer the RBM weights into the weights of the input layer of our neural network as their initialization [<xref ref-type="bibr" rid="scirp.85906-ref14">14</xref>] . The RBM can generate a distribution of different weights to find the image feature better. Thus, we are using RBM’s pre-trained results to produce best initialized weight values for the input neurons in order to increase the training efficiency of the neural network and get even greater accuracy on the validation datasets. Since we used the pre-trained model and thus did not worry about over-fitting too much in this case, we set the hidden layer size of our neural network to be 300, and compared the loss on the validation data with transferred initialized weights to that with randomly initialized weights. The former value was 0.058 and the latter value was 0.094 (shown in <xref ref-type="table" rid="table4">Table 4</xref>), which showed a significant difference. With good initial weights, we</p><table-wrap id="table4" ><label><xref ref-type="table" rid="table4">Table 4</xref></label><caption><title> Validation loss</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle" >Validation Loss</th></tr></thead><tr><td align="center" valign="middle" >a3_rbm_w</td><td align="center" valign="middle" >0.056</td></tr><tr><td align="center" valign="middle" >a3</td><td align="center" valign="middle" >0.091</td></tr></tbody></table></table-wrap><p>can reduce the possibility of over-fitting by a great degree. When implemented, the code functions so that the neural network works to discover relevant information in the distribution of the input images. It means that the neural network will not focus only on the difference of the digit class labels, but will also analyze other information from the input data. In comparison to early-stopping the model in only a few iterations, this method makes the neural network work on something else which is also valuable.</p><p>In the process above, we turned off early-stopping to investigate solely on the effects of good weight-initialization. Now we turn on early-stopping to see if another regularization method would affect the results. The new validation loss with carefully weights initialization is 0.058 which is bigger than the loss without early-stopping but not significantly. Therefore, implementing early-stop is not necessary in our case when we have a good weight initialization.</p></sec><sec id="s5"><title>5. Conclusion</title><p>As we explore the effects of different parameters on the feed-forward neural network, we discover the pattern that the best model is generated when the implemented parameter falls at an intermediate value. It is surprisingly similar to the learning pattern of human brain: learning too slow or having too few neurons to process the learned information would harm the learning efficiency, but learning too fast or thinking too much on a simple topic would also decrease the productivity. As we dig deeper into the function of neural network, we could also decipher more about the secrets of human brains.</p></sec><sec id="s6"><title>Cite this paper</title><p>Fu, Y.X. (2018) An Optimization of Neural Network Hyper-Parameter to Increase Its Performance. Intelligent Information Management, 10, 99-107. https://doi.org/10.4236/iim.2018.104008</p></sec></body><back><ref-list><title>References</title><ref id="scirp.85906-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Thomas, M.S. and McClelland, J.L. (2008) Connectionist Models of Cognition. Cambridge handbook of Computational Cognitive Modelling, 23-58.  
https://doi.org/10.1017/CBO9780511816772.005</mixed-citation></ref><ref id="scirp.85906-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">McCulloch, W.S. and Pitts, W. (1943) A Logical Calculus of the Ideas Immanent in Nervous Activity. The Bulletin of Mathematical Biophysics, 5, 115-133.  
https://doi.org/10.1007/BF02478259</mixed-citation></ref><ref id="scirp.85906-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Preparata, F.P. and Shamos, M.I. (1985) Computational Geometry: An Introduction. Springer, New York, 1-35. https://doi.org/10.1007/978-1-4612-1098-6</mixed-citation></ref><ref id="scirp.85906-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Werbos, P.J. (1974) Beyond Regression: New Tools for Prediction and Analysis in the Behavioral Sciences. Doctoral Dissertation, Harvard University, Cambridge.</mixed-citation></ref><ref id="scirp.85906-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Khosravi, H. and Kabir, E. (2007) Introducing a Very Large Dataset of Handwritten Farsi Digits and a Study on Their Varieties. Pattern Recognition Letters, 28, 1133-1141. https://doi.org/10.1016/j.patrec.2006.12.022</mixed-citation></ref><ref id="scirp.85906-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Jin, W., Li, Z.J., Wei, L.S. and Zhen, H. (2000) The Improvements of BP Neural Network Learning Algorithm. 2000 5th International Conference on Signal Processing Proceedings, Beijing, 21-25 August 2000, 1647-1649.</mixed-citation></ref><ref id="scirp.85906-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Attoh-Okine, N.O. (1999) Analysis of Learning Rate and Momentum Term in Backpropagation Neural Network Algorithm Trained to Predict Pavement Performance. Advances in Engineering Software, 30, 291-302.  
https://doi.org/10.1016/S0965-9978(98)00071-4</mixed-citation></ref><ref id="scirp.85906-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Caruana, R., Lawrence, S. and Giles, C.L. (2001) Overfitting in Neural Nets: Backpropagation, Conjugate Gradient, and Early Stopping. Neural Information Processing Systems, 402-408.</mixed-citation></ref><ref id="scirp.85906-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Tetko, I.V., Livingstone, D.J. and Luik, A.I. (1995) Neural Network Studies. 1. Comparison of Overfitting and Overtraining. Journal of Chemical Information and Computer Sciences, 35, 826-833. https://doi.org/10.1021/ci00027a006</mixed-citation></ref><ref id="scirp.85906-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Krogh, A. and Hertz, J.A. (1992) A Simple Weight Decay Can Improve Generalization. Neural Information Processing Systems, 950-957.</mixed-citation></ref><ref id="scirp.85906-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Baum, E.B. and Haussler, D. (1989) What Size Net Gives Valid Generalization? Neural Information Processing Systems, 81-90.</mixed-citation></ref><ref id="scirp.85906-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Bishop, C.M. (2006) Pattern Recognition and Machine Learning. Springer, New York.</mixed-citation></ref><ref id="scirp.85906-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Salakhutdinov, R., Mnih, A. and Hinton, G. (2007) Restricted Boltzmann Machines for Collaborative Filtering. Proceedings of the 24th International Conference on Machine Learning, Corvalis, 20-24 June 2007, 791-798.  
https://doi.org/10.1145/1273496.1273596</mixed-citation></ref><ref id="scirp.85906-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Knerr, S., Personnaz, L. and Dreyfus, G. (1990) Single-Layer Learning Revisited: A Stepwise Procedure for Building and Training a Neural Network. Neurocomputing: Algorithms, Architectures and Applications, 68, 71.  
https://doi.org/10.1007/978-3-642-76153-9_5</mixed-citation></ref></ref-list></back></article>