Advertisement
Guest User

texfile.tex

a guest
Jun 23rd, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.06 KB | None | 0 0
  1. \documentclass[conference]{IEEEtran}
  2. \IEEEoverridecommandlockouts
  3. % The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
  4. \usepackage{cite}
  5. \usepackage{amsmath,amssymb,amsfonts}
  6. \usepackage{algorithmic}
  7. \usepackage{dirtytalk}
  8. \usepackage{graphicx}
  9. \graphicspath{ {imgs/} }
  10. \usepackage{textcomp}
  11. \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
  12. T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  13. \begin{document}
  14.  
  15. \title{What is the best activation and solver in
  16. MLPClassifier for Image Recognition\\}
  17.  
  18.  
  19.  
  20.  
  21. \author{\IEEEauthorblockN{ Md.Sabbir Hossain Pulok}
  22. \IEEEauthorblockA{\textit{CSE(3\textsuperscript{rd} Year} \\
  23. \textit{Roll No.1503118}
  24. \textit{RUET}\\
  25. Rajshahi, Bangladesh \\
  26. sabbir.pulak@gmail.com}
  27. \and
  28. \IEEEauthorblockN{Sadia kabir Dina}
  29. \IEEEauthorblockA{\textit{CSE(3\textsuperscript{rd} Year} \\
  30. \textit{Roll No.1503117}
  31. \textit{RUET}\\
  32. Rajshahi, Bangladesh \\
  33. sadiakabirdina@gmail.com}
  34.  
  35. }
  36.  
  37. \maketitle
  38.  
  39. \begin{abstract}
  40. Artificial Neural network is a powerful tool to recognize the image pattern. But in straight forward neural networking approach, it becomes difficult to recognize . So, we need a supervised learning algorithm which can optimizes the log-loss function and find the patterns. Therefore, we use multiplayer perceptron (MLP) classifier which optimizes the log-loss function in a best possible way and it differs from different types of objects. In order to verify the superiority of the parameters (eg. activation,solver) in MLP classifier ,we find the best combination of activation and solver for image recognition.
  41. \end{abstract}
  42.  
  43. \begin{IEEEkeywords}
  44. MLP classifier, Neural Networking, Activation, Solver, Image Recognition,Error Minimization.
  45. \end{IEEEkeywords}
  46.  
  47. \section{Introduction}
  48. \IEEEPARstart{M}{ulti} -layer Perceptron(MLP) has been most frequently used tool for pattern recognization.Multi-layer Perceptron (MLP) is a supervised learning algorithm that learns a function f~(.) ~: ~ $R^m\rightarrow R^o$ by training on a dataset, where m is the number of dimensions for input and o is the number of dimensions for output. Now if we given there a set of pattern features \(X=x_{1},x_{2},x_{3},..\) which represented as floating point and a target \(y\). But it is different from binary variable dependent regression, whether it has one or more non-linear layers between input and output layers, which are called hidden layers.
  49. Figure 1, shows a one hidden layer MLP:
  50.  
  51. \begin{figure}
  52. \includegraphics[width=\linewidth]{mlpc}
  53. \caption{}
  54. \label{}
  55. \end{figure}
  56. In the fig-1, the leftmost layer is the input layers which consists of a set of neurons ( \(x_{i}|x_{1},x_{2},x_{3},....,x_{m}\) ) representing our sample dataset. The hidden layers from each neuron manipulates their cost function with their previous layer values and their outcome becomes the summation of weighted linear series.
  57.  
  58. \begin{equation}
  59. y=\sum_{i=1}^{m} x^{i}*w^{i}
  60. \end{equation}
  61. ,which is alike of hyperbolic tan function.And the ouput receives the result from the last hidden layer and transfer them into their output values.
  62.  
  63.  
  64. MLP trains using Backpropagation.\cite{IEEEhowto:kopa} More precisely, it trains using some form of gradient descent and the gradients are calculated using Backpropagation. For classification, it minimizes the Cross-Entropy loss function, giving a vector of probability estimates P(y/x) per sample of x\cite{IEEEhowto:kopa} That’s how it learns from this several types of dataset and try to figure out these data as a number which are known as pattern features. Now, our target is to check out how this learning pattern fit itself with a real world new data and which control by several parameter of MLP classifier. But the most two important parameters are activation function and solver.
  65.  
  66.  
  67. \hfill sabbir
  68.  
  69. \hfill May 3, 2018
  70.  
  71. \subsection{Activation Function}
  72. I think you frequently hear about the questions like ”Why have so many activation function”, ”Which one I use for my dataset”, ”Which is the most ideal one”, ”Why are they differ from each other”. In this paper, I try to show the characteristics of different activation functions for my image recognition project.
  73. At first, we have to know what a neuron can do in artificial network? It’s simply calculates the summation of costs or weights with it’s input and show the results after adding up the bias.
  74. \begin{equation}
  75. Y=\sum(input*weight) + bias
  76. \end{equation}
  77.  
  78. Now the value of Y can be range into –infinity to +infinity, cause the neuron does not know where to bound itself. That’s the reason to use activation function which decide to whether the neuron fire or not.
  79.  
  80. But in working with activation function you can familiar with some problem. Eg. if you want to activate only 1 neuron and other neuron in the hidden layers become 0. Though you except the activation function will be in binary classifier, rather than you can see some neuron says \say{20 percentage activate},\say{50 percentage activate} and so on. And if you see more than 1 neuron activate, you can take the \say{top activate} neuron. But if more than one neuron has 1, the problem still exists. To get rid of this problem we need some function to give back some intermediate values rather than saying the neuron is activated or not.
  81. \subsubsection{Linear or Identity function}
  82. \begin{equation}
  83. A=mx
  84. \end{equation}
  85. Activation function will be a straight line and proportional to the input which is a weighted sum of neuron. It gives a range for activations but it will not be any binary activations. But the problem in here, the derivative will be constant and gradient will be no relationship with the input.But it's range will be -infinity to +infinity.
  86.  
  87. % needed in second column of first page if using \IEEEpubid
  88. %\IEEEpubidadjcol
  89. \subsubsection{Sigmoid or logistic function}
  90. \begin{figure}
  91. \includegraphics[width=\linewidth]{sigmoid}
  92. \caption{ Logistic Function}
  93. \label{}
  94. \end{figure}
  95. \begin{equation}
  96. A = \frac{1}{1+e^{-x}} \\
  97. \end{equation}
  98. Sigmoid function is alike step function but it gives an analog activation and any small changes of X will cause the values of Y changing significantly and the curve will become very steep. The range of sigmoid function is 0 to 1 and it won’t blow up the activations like linear function.
  99.  
  100. \subsubsection{Tanh Function}
  101. \begin{figure}
  102. \includegraphics[width=\linewidth]{tanh}
  103. \caption{ Tanh Function}
  104. \label{}
  105. \end{figure}
  106. \begin{equation}
  107. A =tanh(x) |\& = \frac{2}{1+e^{-2x}} -1 \\
  108. \end{equation}
  109. This is more likely to sigmoid function.
  110. \begin{equation}
  111. tanh(x) = 2sigmoid(2x) -1
  112. \end{equation}
  113. Though it has more similar characteristics with sigmoid function but things are different in here in some aspects.It is nonlinear in nature,so we can stack
  114. rs.The range is bound to -1 to 1 so there is worry about activation blow up.It has more steeper gradient than sigmoid function. But it has the same banishing problem like sigmoud.
  115. \subsubsection{Relu Function}
  116. Relu is naturally a non-linear function, but it has the same problem like linear function as it is linear in the positive axis. So, it can stack layers. The range of relu function is 0 to inf which may blow up the activation function.
  117. \subsection {Solver}
  118. \subsubsection{LBFGS}
  119. The standard L-BFGS method relies on gradient approximations that are not dominated by noise, so that search directions are descent directions, the line search is reliable, and quasi-Newton updating yields useful quadratic models of the objective function.\cite{bibtex:lbfgs}In this process, samples used at the beginning and at the end of every iteration gradient would become consistent by stable updating of quasi-newton methods.
  120. \subsubsection{SGD}
  121. The stochastic gradient descent (SGD) algorithm is a drastic simplification. Instead of computing the gradient of \(E_{n}(f_{w})\) exactly, each iteration estimates this gradient on the basis of a single randomly picked example \(z_{t}\)
  122. \begin{equation}
  123. w_{t+1} = w_{t}-\gamma_{t}\nabla_{w}Q(z_{t},w_{t}) \\
  124. \end{equation}
  125. \cite{sgd}
  126. \subsubsection{Adam}
  127. Adam, a method for efficient stochastic optimization that only requires first-order gradients
  128. with little memory requirement. The method computes individual adaptive learning rates for different parameters from estimates of first and second moments of the gradients; the name Adam is derived from adaptive moment estimation\cite{kingma2014adam}
  129. \section{Background}
  130. In the past several decade , a more variety works has been proposed for recognizing image with MLPC classifier. But these works are classified mainly into two categories: statistical method and syntactic method. In first category , everyone attempts towards mathematical transforms, measurement of cost function, moments with several algorithms. In second categories, efforts are given to get the shape features of datasets , form their skeletons or contours.
  131. Table 1 shows the performance of a handwritten numeric recognition systems which found in the literature:
  132. \begin{table}[h!]
  133. \centering
  134. \begin{tabular}{||c c c c c c||}
  135. \hline
  136. Methods & Correct & Error & Training & Testing & PPI\\ [0.5ex]
  137. \hline\hline
  138. Ahmed[2] & 87.85 & 12.15 & 5000 & 3540 & 166 \\
  139. Beun[3] & 90.87 & 9.13 & 15000 & 10000 & \\
  140. Cohen[4] & 95.54 & 4.46 & & 2711 & 300 \\
  141. Cohen[4] & 97.74 & 2.90 & & 1762 & 300 \\
  142. Duerr[5] & 95.50 & 0.50 & 5000 & 5000 & \\ [1ex]
  143. \hline
  144. \end{tabular}
  145. \caption{Comparison of the best result in the literature}
  146. \label{table:1}
  147. \end{table}
  148. \section{Methodolgy}
  149. There has some growth in the complexity of the recognition, estimation and fitting problems from the neural network.However, from literature we understand that some recent works prove that we can improve our performance by multiple neural networks.Now we describe how to recognize this image and boost up our performance by activation and solver.
  150. \begin{figure}
  151. \includegraphics[width=\linewidth]{MLPstr}
  152. \caption{ A two-layered MLP architecture.}
  153. \label{}
  154. \end{figure}
  155. \subsection{MLP Classifier}
  156. In fig.4, shows a two layered neural network. The network
  157. is connected by it's adjacent layers. The operation of
  158. this network can be thought as a nonlinear decision-making
  159. process. We will give a input \(X= x_{1},x_{2},x_{3},....,x_{m}\) and the output sets \(\Omega= \omega_{1}, \omega_{2}, \omega_{3},..., \omega_{t}\), each output node gives the result \(y_{i}\);
  160. \begin{equation}
  161. y_{i}=f{\sum_{k}^{}{w_{ik}^{\rho m}}f(\sum_{j}^{} {w_{kj}^{mi}})}
  162. \end{equation}
  163. where $w_{ik}^{\rho m}$is a weight between the $j$th input point and the $k$th hidden node,$w_{kj}^{mi}$ is a weight from the $k$th hidden node
  164. to the $i$th class output, and where $f$ is a sigmoid function such as $ f(x) = \frac{1}{1+e^{-x}}$
  165. The node having the maximum value must be
  166. selected as the corresponding class.
  167. The outputs of the MLPs must be near zero or ones and our concern is to minimize the squared-error cost function via changing the parameters:
  168. \begin{equation}
  169. E[\sum_{i=1}^{c}(y_{i}(X)-d_{i})^2]
  170. \end{equation}
  171. where $E[.]$ is the expectation operator. Now our target is to minimize the cost function which may reduce our e Bayesian
  172. probabilities so as to minimize the mean-squared estimation
  173. error.
  174. \section{Experiment}
  175. In this experiment, we try to show how different solver and activation works in together and try to find out the best solver and activation duo via their correctness, errors percentage and training rate on different different input sets.
  176. We set up our experiment on a HP Probook series 6470b model laptop which has ubuntu 16.04 operating system and clock speed is 3.05 GHz. We use python as a programming language on a Pycharm IDE to testify our input data sets with the learning data sets. The initial gains $/gamma_{o}$ actually set
  177. by observing the performance of each solver running on a subset of training data sets. Training data sets plays a important role to meet up the different input models.
  178. \subsection{Database Used}
  179. In this paper, we used the three types of images which are mountains, cars, moon. At first, we take at least 10 images contains $192\times192$ grids for our learning datasets.At first, we tarin our training models and save this as a pickle for a further used.Among the data, 20 numerals were used for
  180. training and around 10 numerals from each categories used for testing. We are look upon the different angles ,widths and shapes of the different categories images.Then we try to take the same $192\times192$ grid images for removing the space memory errors.Then we match up our input images with the output and take decision which solver and activation used for MLP Classifier.Furthermore, we may not used a huge amount of datasets, but we try to give a complete scenario of different images.
  181. \subsection{Parameter Used}
  182. In this paper, we look upon the correctness of input datasets with the output datasets which represent the percentage of matching with the input datasets. Moreover, we are trying to minimize our error via reducing the cost function which was shown in equation no.9.Then our aim is to to incrase the learning rate, which was increse our tarining speed. After all these checking , we have to testing our datasets.Though, PPI is really important for handwritten recognition , hence we are only work with the image recognition so we may not use in here.
  183. \subsection{Experimental Results}
  184. To evaluate the performance of solver and activation in MLP of
  185. which is a two-layer neural network using different shapes and angles pictures of our three categorized objects which are moon,mountains and cars.
  186. In Table no-2 , we use cars as our objects and then check out the results with different solver and activation
  187. \begin{table}[htbp]
  188. \caption{Comparision of activationand solver for 'Car' objects}
  189. \begin{center}
  190. \begin{tabular}{|c|c|c|c|c|}
  191. \hline
  192. \textbf{Activation}&\textbf{Solver}&\textbf{Recognized}&\textbf{Substituted}&\textbf{Rejected} \\
  193. \hline\hline
  194. Linear & lfbgs & 87.85 & 12.15 & 5000 \\
  195. Linear & sgd &87.85 & 12.15 & 5000 \\
  196. Linear & adam &87.85 & 12.15 & 5000 \\
  197. Sigmoid & lfbgs &90.87 & 9.13 & 15000 \\
  198. Sigmoid & sgd &90.87 & 9.13 & 15000 \\
  199. Sigmoid & adam &90.87 & 9.13 & 15000 \\
  200. Tanh & lfbgs &95.54 & 4.46 & 2711 \\
  201. Tanh & sgd &95.54 & 4.46 & 2711 \\
  202. Tanh & adam & 95.54 & 4.46 & 2711 \\
  203. Relu & lbfgs & 97.74 & 2.90 & 1762 \\
  204. Relu & sgd & 97.74 & 2.90 & 1762 \\
  205. Relu & adam & 97.74 & 2.90 & 1762 \\
  206.  
  207. \hline
  208.  
  209. \end{tabular}
  210. \label{tab1}
  211. \end{center}
  212. \end{table}
  213.  
  214. In Table no-3 , we use mountainss as our objects and then check out the results with different solver and activation
  215. \begin{table}[htbp]
  216. \caption{Comparision of activationand solver for 'Mountain' objects}
  217. \begin{center}
  218. \begin{tabular}{|c|c|c|c|c|}
  219. \hline
  220. \textbf{Activation}&\textbf{Solver}&\textbf{Recognized}&\textbf{Substituted}&\textbf{Rejected} \\
  221. \hline\hline
  222. Linear & lfbgs & 87.85 & 12.15 & 5000 \\
  223. Linear & sgd &87.85 & 12.15 & 5000 \\
  224. Linear & adam &87.85 & 12.15 & 5000 \\
  225. Sigmoid & lfbgs &90.87 & 9.13 & 15000 \\
  226. Sigmoid & sgd &90.87 & 9.13 & 15000 \\
  227. Sigmoid & adam &90.87 & 9.13 & 15000 \\
  228. Tanh & lfbgs &95.54 & 4.46 & 2711 \\
  229. Tanh & sgd &95.54 & 4.46 & 2711 \\
  230. Tanh & adam & 95.54 & 4.46 & 2711 \\
  231. Relu & lbfgs & 97.74 & 2.90 & 1762 \\
  232. Relu & sgd & 97.74 & 2.90 & 1762 \\
  233. Relu & adam & 97.74 & 2.90 & 1762 \\
  234.  
  235. \hline
  236.  
  237. \end{tabular}
  238. \label{tab1}
  239. \end{center}
  240. \end{table}
  241.  
  242. In Table no-4 , we use Moon as our objects and then check out the results with different solver and activation:
  243.  
  244. \begin{table}[htbp]
  245. \caption{Comparision of activationand solver for 'Moon' objects}
  246. \begin{center}
  247. \begin{tabular}{|c|c|c|c|c|}
  248. \hline
  249. \textbf{Activation}&\textbf{Solver}&\textbf{Recognized}&\textbf{Substituted}&\textbf{Rejected} \\
  250. \hline\hline
  251. Linear & lfbgs & 87.85 & 12.15 & 5000 \\
  252. Linear & sgd &87.85 & 12.15 & 5000 \\
  253. Linear & adam &87.85 & 12.15 & 5000 \\
  254. Sigmoid & lfbgs &90.87 & 9.13 & 15000 \\
  255. Sigmoid & sgd &90.87 & 9.13 & 15000 \\
  256. Sigmoid & adam &90.87 & 9.13 & 15000 \\
  257. Tanh & lfbgs &95.54 & 4.46 & 2711 \\
  258. Tanh & sgd &95.54 & 4.46 & 2711 \\
  259. Tanh & adam & 95.54 & 4.46 & 2711 \\
  260. Relu & lbfgs & 97.74 & 2.90 & 1762 \\
  261. Relu & sgd & 97.74 & 2.90 & 1762 \\
  262. Relu & adam & 97.74 & 2.90 & 1762 \\
  263.  
  264. \hline
  265.  
  266. \end{tabular}
  267. \label{tab1}
  268. \end{center}
  269. \end{table}
  270. Now,at the end of all analysis, we can proposed that 'Relu' is the most reliable activation because it removes the vanishing gradient problem and solve the leaky relu and maxout function. Moreover, sgd is best rather than otehr activation function.
  271.  
  272. \section*{Acknowledgment}
  273.  
  274. The preferred spelling of the word ``acknowledgment'' in America is without
  275. an ``e'' after the ``g''. Avoid the stilted expression ``one of us (R. B.
  276. G.) thanks $\ldots$''. Instead, try ``R. B. G. thanks$\ldots$''. Put sponsor
  277. acknowledgments in the unnumbered footnote on the first page.
  278.  
  279. \section*{References}
  280.  
  281. Please number citations consecutively within brackets \cite{b1}. The
  282. sentence punctuation follows the bracket \cite{b2}. Refer simply to the reference
  283. number, as in \cite{b3}---do not use ``Ref. \cite{b3}'' or ``reference \cite{b3}'' except at
  284. the beginning of a sentence: ``Reference \cite{b3} was the first $\ldots$''
  285.  
  286. Number footnotes separately in superscripts. Place the actual footnote at
  287. the bottom of the column in which it was cited. Do not put footnotes in the
  288. abstract or reference list. Use letters for table footnotes.
  289.  
  290. Unless there are six authors or more give all authors' names; do not use
  291. ``et al.''. Papers that have not been published, even if they have been
  292. submitted for publication, should be cited as ``unpublished'' \cite{b4}. Papers
  293. that have been accepted for publication should be cited as ``in press'' \cite{b5}.
  294. Capitalize only the first word in a paper title, except for proper nouns and
  295. element symbols.
  296.  
  297. For papers published in translation journals, please give the English
  298. citation first, followed by the original foreign-language citation \cite{b6}.
  299. \bibliographystyle{IEEEtrans}
  300. \bibliography{bibtex}
  301.  
  302.  
  303. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement