Full text
i Single layer optimization with Particle Swarm Optimization Guilherme de Oliveira Crespo Martins A new approach to optimize Deep Neural Networks Dissertation presented as partial requirement for obtaining the Master’s degree in Advanced Analytics
ii NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa SINGLE LAYER OPTIMIZATION WITH PARTICLE SWARM OPTIMIZATION by Guilherme Martins Dissertation presented as partial requirement for obtaining the Master’s degree in Advanced Analytics Advisor: Mauro Castelli Co Advisor: Illya Bakurov
ACKNOWLEDGEMENTS I would like to thank... My teachers at Nova IMS from which I learned so much over the last years, in particular my supervisor, Prof. Dr. Mauro Castelli and Prof. Illya Bakurov for helping me develop this thesis and, along with Prof. Dr. Leonardo Vanneschi, for sparking my interest in the topic of Machine Learning. My parents for having the patience and dedication to support me over the last 24 years and to whom I owe everything. iii
ABSTRACT Deep Neural Networks attempt to simulate the behaviour of the brain to solve complex problems. Today, they are currently used for various real world applications such as natural language processing, image recognition, self‐driving cars, and much more. However, these models, can be very computationally expensive and take a considerable amount of time to train. In this thesis, we attempt to use swarm intelligence to optimize Deep Neural Networks with a smaller computational budget. To achieve this goal, we implement a method that takes any model and selects the layer that can contribute the most for the optimization of said model. Afterwards, we further optimize the layer selected with the Particle Swarm Optimization algorithm in an attempt to take advantage of its ability to surpass local optimums. Keywords machine learning; deep neural networks; particle swarm optimization; gradient descent; computer vision iv
Contents 1 INTRODUCTION 1 1.1 DeepLearning................................... 1 1.2 Challenges of deep learning problems . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Objectives..................................... 3 2 THEORETICAL BACKGROUND 4 2.1 DeepLearning................................... 4 2.1.1 Learningtolearn............................. 5 2.1.2 Batchnormalization ........................... 8 2.1.3 Convolution................................ 9 2.1.4 Residual Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2 LayerImportance................................. 11 2.3 Particle Swarm Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.4 Swarm intelligence and evolutionary algorithms in neural network optimization 17 2.5 Other approaches to training optimization . . . . . . . . . . . . . . . . . . . . 21 3 PROPOSED APPROACH 21 3.1 Models ...................................... 22 3.2 Pre‐trainingmodels................................ 23 3.3 LayerSelection .................................. 23 3.3.1 Pruningselection............................. 23 3.3.2 Classifierlayer .............................. 24 3.4 LayerOptimization ................................ 24 3.4.1 Particle Swarm Optimization . . . . . . . . . . . . . . . . . . . . . . . 25 3.4.2 Single layer gradient based optimization . . . . . . . . . . . . . . . . . 26 3.4.3 Performance Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.4.4 Implementation and tools used . . . . . . . . . . . . . . . . . . . . . 27 4 EXPERIMENTAL SETUP 27 4.1 Datasets...................................... 27 4.2 Pre‐trainingmodels................................ 28 4.3 LayerOptimization ................................ 28 5 RESULTS 30 5.1 Pre‐trainingmodels................................ 30 v
5.2 Layerselection .................................. 32 5.3 LayerOptimization ................................ 33 5.3.1 BaselinePSO ............................... 33 5.3.2 Single layer gradient optimization . . . . . . . . . . . . . . . . . . . . 42 5.3.3 Inertia................................... 47 5.3.4 PositionalBounding ........................... 47 5.3.5 VelocityBounding ............................ 49 5.3.6 Populationsize .............................. 50 5.3.7 Cognitive and Social factors . . . . . . . . . . . . . . . . . . . . . . . 52 5.3.8 Futurework................................ 53 6 CONCLUSION 54 7 BIBLIOGRAPHY 57 vi
List of Figures 1 Hierarchy of concepts in a deep learning model (Source: [1]) . . . . . . . . . . 2 2 Perceptron(Source:[2]) ............................. 4 3 A simple fitness landscape (Source: [3]) . . . . . . . . . . . . . . . . . . . . . 6 4 A 3x3 kernel (Source: [4]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5 Comparison between a normal and a residual block (Source: [5]) . . . . . . . . 11 6 Visualization of the movement of a particle in a two dimensional search space . 15 7 Matrix encoding information about a FeedForward Neural Network (Source: [6]) 18 8 Possible NN configurations (Source: [7]) . . . . . . . . . . . . . . . . . . . . . 19 9 SimpleNetArchitecture.............................. 22 10 ResNet Architecture (Source: [8]) . . . . . . . . . . . . . . . . . . . . . . . . . 23 11 Average validation loss in pre‐training with best parameters . . . . . . . . . . 31 12 Baseline train and validation loss . . . . . . . . . . . . . . . . . . . . . . . . . 34 13 Step size in SimpleNet model with the FashionMNIST dataset . . . . . . . . . . 34 14 Average validation loss of SimpleNet in FashionMnist . . . . . . . . . . . . . . 35 15 Average validation loss of ReducedResNet in FashionMnist . . . . . . . . . . . 35 16 Average validation loss of ResNet18 in FashionMnist . . . . . . . . . . . . . . 36 17 Average validation loss of SimpleNet in CIFAR10 . . . . . . . . . . . . . . . . . 37 18 Average validation loss of ReducedResNet in CIFAR10 . . . . . . . . . . . . . . 37 19 Average validation loss of ResNet18 in CIFAR10 . . . . . . . . . . . . . . . . . 37 20 Average validation loss of SimpleNet in CIFAR100 . . . . . . . . . . . . . . . . 38 21 Average validation loss of ReducedResNet in CIFAR100 . . . . . . . . . . . . . 39 22 Average validation loss of ResNet18 in CIFAR100 . . . . . . . . . . . . . . . . . 39 23 Relation between step size and fraction of seeds that changed best solution per iteration...................................... 40 24 Relation between step size and fraction of seeds that changed best solution per iteration...................................... 40 25 Population mean training loss . . . . . . . . . . . . . . . . . . . . . . . . . . 41 26 Change in loss with and without best solution change . . . . . . . . . . . . . . 42 27 Best validation loss of single layer gradient optimization . . . . . . . . . . . . . 45 28 Adam optimizer on ResNet18 in Cifar100 . . . . . . . . . . . . . . . . . . . . . 46 29 Average % improvement over best validation in pre‐training . . . . . . . . . . 46 30 Average step size in the FashionMnist dataset . . . . . . . . . . . . . . . . . . 47 31 Average training loss per inertia experiment . . . . . . . . . . . . . . . . . . . 48 32 Validation loss of positional bounding experiment . . . . . . . . . . . . . . . . 48 vii
33 Step size in SimpleNet model with the FashionMNIST dataset . . . . . . . . . . 49 34 Average population training loss . . . . . . . . . . . . . . . . . . . . . . . . . 50 35 Best validation loss of population experiments in FashionMnist . . . . . . . . . 51 36 Average % of best solution changes . . . . . . . . . . . . . . . . . . . . . . . 52 37 Average population size per layer dimensions . . . . . . . . . . . . . . . . . . 52 38 Averaged best validation loss . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 viii
List of Tables 1 Best average validation loss and accuracy per dataset . . . . . . . . . . . . . . 30 2 Best overall average validation loss . . . . . . . . . . . . . . . . . . . . . . . . 30 3 Pruning method layer selection . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4 Single Layer Optimization results . . . . . . . . . . . . . . . . . . . . . . . . . 44 5 Effects of velocity bounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 ix
Figure 3: A simple fitness landscape (Source: [3]) point. It informs the way in which to change x (in this case, layer weights) in order to reduce y (our cost function). The use of derivatives to improve model’s performance is called gradient descent and was first published in [19]. This method, described by the formula in (1), introduces a velocity to the weight wequal to the derivative of the loss function with respect to the given weight, that is then regulated by a learning rate η, a value usually between 0 and 1. vt=η∇L(w)(1) wt+1 =wt−vt(2) However using all samples of the training set to calculate the loss for each training step would be computationally intensive. In order to accelerate this process, instead of using all samples, a single data point or a subset of the training set can be used. This method is called Stochastic Gradient Descent and is what many consider the base optimization method for DL. Since this first approach to the optimization of ANNs, several improvements were made to deal with different problems that were faced. In 1964 the concept of momentum was introduced in the field in [20] which improved the performance of models particularly in certain scenarios often visualized as ravines in the fitness landscape. In these situations, the typical behaviour of the SGD has trouble reaching the center of said ravine in a straight forward fashion instead oscillating around the edges. By introducing a percentage βof the t−1velocity, as shown in formula 3, this method partially conserves the direction of the previous gradient. This modified 6
behaviour would enable a point to move to the center of a ravine with less oscillation. vt=βvt−1+η∇L(w)(3) Despite its improvements, the SGD with momentum still had its issues. The same properties of the method that would enable it to converge quicker on a optimum could also overshot the target causing the solution to start climbing uphill. Ideally, the optimization method should be somewhat aware that with its current momentum it will miss the optimal point. To address this problem the Nesterov accelerated gradient was introduced [21]. This algorithm attempts to give the optimizer this knowledge by calculating the gradient not with respect to the current position, but instead with respect to an approximate future position as shown in 4. vt=βvt−1+η∇L(w−βvt−1)(4) These previous methods and many others like them, however, failed to dynamically adapt the method itself to the input data the algorithm was receiving. In [11] researchers John Duchi, Elad Hazan and Yoram Singer introduced a new algorithm that implemented this characteristics. AdaGrad, as they called it, assimilates information seen in previous iterations to inform the size of the learning rate. To achieve this, each parameter update is altered to divide the learning rate by a component Dt, defined in (7), that adapts the learning rate based on previous gradients. gt=η∇L(wt)(5) Gt= t ∑ τ=1 (gτ∗gτ)(6) Dt=√ϵ+Gt(7) vt=η Dt ∇L(wt)(8) Here, each weight wtis updated by the product of the adjusted learning rate and the gradient of the wtat time t. The parameter ϵis an extremely small value that prevents divide by zero errors. Despite its advantages, one major problem with this approach was that the learning rate would approach zero as the sum of gradients increased with iterations, at which point the model could not learn any new information. To counter this behaviour, researchers in 7
[22] proposed AdaDelta, a method that recursively calculates past averages of gradients. More specifically, considering: g2=gτ∗gτ(9) We get the recursive average: A[g2]t=γA[g2]t−1+ (1 −γ)g2 t(10) Which replaces the parameter Dtin the denominator of the update function which becomes: Dt=√ϵ+A[g2]t(11) Finally, in [12], the Adam algorithm is introduced. In addition to calculating the average of past gradients, an exponentialy decaying average is also accounted by E[g]t=γE[g]t−1+ (1 −γ)gt(12) Which changes the update to: vi t=η √A[g2]t+ϵE[g]t(13) This difference between Adagrad and Adam enables the latter to converge faster in Convolutional Neural Networks (CNNs) as shown in [12]. 2.1.2 Batch normalization As described previously, it is advantageous to ANNs that the distribution of the training data has a similar distribution to the test data in order to ensure proper learning. This property also applies to each particular input of each layer in the network. After all, due to its recursive nature, the formula that describes a neural network is similar to the one that describes a single layer. For example, a simple two layered network can be described by the formula 14, where the input iis fed to F1with weights Θ1. However if we simplify the formula so that F1(i, Θ1) = xwe end up with 15 which means that the gradient descent step of this second equation is equivalent to that of the whole network. With this demonstration we can say that the input distribution characteristics are also valid at the layer level. L=F2(F1(i, Θ1),Θ2)(14) 8
L=F2(x, Θ2)(15) Yet, the input distribution of a specific layer is always changing due to the variations in the output of previous layers. In order to fix this problem a Batch Normalization layer is introduced in between convolutional layers in order to keep the distribution of the inputs constant throughout the training of the neural network. As described in [23], this layer uses the mean and standard deviation of each feature over a batch size and applies a scaling (γ) and shifting (β) factor, formalizing the equation in 17. x=x−E[x] √V ar(x)(16) y=γx +β(17) 2.1.3 Convolution In many real world scenarios, data has more than one dimension. For instance, in problems such as image recognition, a picture can be processed as a two dimensional input. These types of problems, in order to be solved, require, then, a model that has to be proportionally bigger, which presents several challenges with respect to memory usage and computation power. In order to mitigate these problems, convolutional layers were introduced into DL models. More classical ANNs typically connect every input to every output, this approach however would prove extremely intensive on the computer’s resources, to reduce this complexity, a convolutional layer has sparse interactions. Instead of connecting every input with every output, convolutional layers filter input layers with a (usually) smaller window, more commonly know as a kernel (Figure 4). In practice, this means we can store less parameters and perform fewer operations. The efficiency improvements can be quite large as a matrix multiplication performed in regular ANNs takes O(m∗n) while if we reduce the number of connections to kwe end up with O(k∗n). Another dimension in which convolutional layers improve efficiency has to do with parameter sharing. In a traditional neural network, each connection from nlto nl+1 has its own weight w, inside a convolutional layer however, weights inside the kernel are used across the entire input layer significantly reducing the number of parameters. If we think of an input layer l0as a matrix of 30 rows by 30 columns connecting to a layer l1with size 20x20, in a regular neural network we would end up with 302∗202weights, while a convolutional layer with 5x5 kernel would have 25 weights. 9
Figure 4: A 3x3 kernel (Source: [4]) 2.1.4 Residual Neural Networks Introduced in [8], the Deep Residual Network (ResNet) is a convolutional neural network that introduces a residual framework into the network. As the network gets deeper, the gradient needs to pass more and more multiplications to get to the layers closer to the input. As it does the gradient can get smaller and smaller until it approaches 0 and the network can no longer improve and, in some cases, will even degrade in performance. This problem is also refered to as the vanishing gradient problem. Similarly, with network deepness, input information from the samples as well as from earlier layers, gets lost with the several weight multiplications and sums it goes throughout the network until the final output layer. To solve these issues, the research team found that it is easier to optimize a residual of the target function than the actual target function. More specifically, if we consider a block of 2 consecutive convolutional layers that would normally optimize an identity function F(x), and instead added a shortcut connection that would subtract the input to the output of the 2 convolutional layers, we would make it so the convolutional block optimizes for F(x)−x, as shown in Figure 5, which in essence gives additional information about the input data to deeper layers. This method allowed the researchers to achieve better results compared with other models with similar depth. 10
Figure 5: Comparison between a normal and a residual block (Source: [5]) 2.2 Layer Importance In ANNs, several authors propose to use calculate the importance of layers and neuron connections in order to then prune the network’s architecture, removing the least important components of the model. In [24] the authors propose a novel method to identify which layers to remove from the network by applying a scaling factor the each individual layer in the network. This scaling factor is set to 1 and trained along side the weights of the network. With enough training, scalars attached to layers considered less useful will approach 0, effectively neutralizing them. One advantage of this approach is that it can use the scaling factors present in batch normalization, which is a type of layer already embedded in many of the currently used CNNs, and therefore cut down on the added computational costs. 2.3 Particle Swarm Optimization Particle Swarm Otimization (PSO) is a search algorithm in which a population of particles moves to find an optimal point in its environment (search space). The origins of the PSO can be traced back to the Boid (Bird‐oid) model designed by Reynolds in 1987 [25]. Inspired by the movement of flocks, a system was created where several particles, named boids , in a coordinate system follow three base rules from which flock behaviour emerges. The boids should firstly avoid collisions with nearby flockmates, secondly they should match velocities with nearby boids , and finally they should also attempt to stay close to the center of the flock. Later on, Heppner designed a model were the flock would move towards a pre‐determined point, a ”roost”. This was achieved by adding a homing and a randomness variable. The homing variable determined the attraction the boids felt to the ”roost”, whilst the random variable introduced some variation 11
to the flocks behavior, similar to what would be observed in the wild. This approach to the problem of simulating flock behavior led researchers to ask questions about how birds would find food. Unlike the ”roost” in Heppner’s simulation, the flock of birds would not know the location of food. Yet, if a bird feeder is placed within hours, birds will come to its location. This behavior led researchers to suspect that birds had ways of capitalizing on each other’s knowledge. Based on this thought process, James Kennedy introduces the ”cornfield vector” [18]. Each boid would evaluate its current position based on equation (18) and would remember their past best position as well as its value. Moreover, each boid would also remember the best position that any boid of the flock had reached. Eval =√(presentx −100)2+√(presenty −100)2(18) The results from this approach had surprisingly good results. The flock would very quickly converge on the point of lowest score, which in this case was the point at (100,100). More importantly, it proved that the algorithm could find the optimal point without giving the point’s location to the flock in advance. After further research and experiments, it was found that the algorithm would work just as well and look just as realistic without the added randomness variable, so it was removed. Next velocity matching was also found to slow the speed of convergence, altought it made the movement of the boids look more realistic it to was removed. What was left was an algorithm that could effectively find the best solution to a variety of problems. Following this research, in 1995 Kennedy and Eberhart in [18] introduce the PSO algorithm. As described previously, in this algorithm particles with no mass or volume represent solutions to the problem that is being solved and move through the solution space influenced by a social and a cognitive behaviour. However, before describing their movement in this search space it is necessary to define how they are initialized and how many of these particles need to exist. The solution to the first question is quite simple. All particles start with a randomized position and velocity within the search space that can be constrained to some degree. As suggested in [26] and [27] particles should always be constrained to a maximum velocity defined as vmax. This constraint serves as insurance that the particles don’t become so fast that they move past optimums and keeps particles consigned to more local search space. If, on the other hand vmax is too low the particle’s movement becomes limited and may cause particles to not explore sufficiently beyond local solutions [26]. In [18], the researches introduce a velocity limit vmax,j that limits the particles’s velocity in dimension jaccording to the formula in 19. 12
vt+1 i,j = vt+1 i,j if −vmax,j ≤vt+1 i,j ≤vmax,j vmax,j if vmax,j < vt+1 i,j −vmax,j if vt+1 i,j <−vmax,j (19) However in a situation where the velocity of a specific particle hits the limit in one or more dimensions, with this approach, its direction would be changed. For example, if a particle had a velocity vector with values [2,6,3,4] and the limit for all dimensions was 5 then the velocity vector would be changed to [2,5,3,4]. This problem would be a characteristic of all environments with a number of dimensions bigger then 1. Another approach, as described in [28], is to limit the magnitude of the velocity vector to some vmax. When this limit is surpassed, the velocity vector is updated according to equation 20 which reduces the particle’s velocity by a factor without changing its direction. vt+1 i= vt+1 iif |vt+1 i| ≤ vmax vmax |vt+1 i|vt+1 iif |vt+1 i|> vmax (20) In some cases it is also beneficial to constrain the search space itself, this can be either due to some solution imposed restrictions or if the optimum solution is known to be within a confined location in the search space. In [27], researchers suggested that, particles that exceed this domain are re‐randomized. This re‐randomization is applied to both position and velocity. However, optimal positions in the search space will be hard to reach with this definition since particles that move even slightly of the domain previously defined get moved to a completely random location. A possible solution to this problem could be to push particles that hit the ”walls” in the opposite direction by a percentage of the speed they previously had. The second question is tied to the problem’s complexity which can be defined by the number of local optimums, the dimensions of the search space and some possible constraints. In [29], Piotrowski et al. suggest population sizes between 50 to 300 particles should be used in real world problems. With these questions asked we can begin to understand how particles in the PSO move. The velocity of each particle is influenced by two factors: social and cognitive. The cognitive factor represents the particle’s ability to always remember its best past position. This position is defined by researchers as pbestiwhich contains the best past position of particle i. In similar fashion, the social factor represents the swarms ability to communicate information with each other and contains the best position of any particle in the swarm. The set of coordinates values associated to this global best solution is defined as gbest. These two criteria will deter‐ 13
mine much of the path the particles wil take during the optimization process. Each particle iis expressed in the search space with two characteristics which are mathematically defined as vectors. The xi(t)defines the particles position at time tand the vector vi(t)define the particle’s velocity. As described earlier, position changes of the particles are affected by the previously defined pbestiand gbest. This update is done by calculating the distance between these coordinates and the current position of each particle at iteration tand integrating these values into the calculation of the updated velocity vector. More specifically, the velocity vector of particle i at time tis updated by taking to account the distance between the coordinates associated with the personal best value, i.e., pbesti, and the current position of the particle, weighed by R1, a random value within the range of 0 and 1 generated by a uniform distribution at each iteration, and by c1, a positive valued constant named the cognitive acceleration constant. This second component represents the linear attraction towards the best position ever found by particle i pbesti. The distance between the coordinates associated with the global best value, i.e., gbest, and the current position of the particle, weighed by R2, a random value within the range of 0 and 1 generated by a uniform distribution at each iteration, and by c2, a positive valued constant named the social acceleration constant. This last component is described as the linear attraction towards the best position ever found by any particle in the group, gbest, thus named ”social knowledge”. The velocity equation is then defined as described in (21) vi(t) = vi(t−1) + c1∗R1∗(pbesti−xi(t−1)) + c2∗R2∗(gbest −xi(t−1)) (21) The position of each particle i, at time tis then determined by the sum of the previous position vector xi(t−1) and the updated velocity vector vi(t)computed by (21) as shown in equation (22). x=x+vx(22) Assuming a two‐dimensional search space, one can visualize a movement of a particle from t−1to tas shown in Figure 6. This version of the PSO however was not a very effective tool for optimization problems and in 1998 Shi and Eberhart [30] proposed a new formula that introduced the concept of inertia. 14
Figure 6: Visualization of the movement of a particle in a two dimensional search space vi(t) = w(t)∗vi(t−1) + c1∗R1∗(pbesti−xi(t−1)) + c2∗R2∗(gbest −xi(t−1)) (23) As its name suggests, the inertia (w) variable would determine how much the previous velocity would affect the new one, effectively reducing the importance of previous knowledge. This variable also brought a trade‐off between the local search ability and the global search ability intrinsic to the equation. Furthermore, the researchers found that an adaptive inertia, more specifically one that would decrease with time produced promising results. One possible way to describe this change in the inertia value can be described by the equation in (24). Here, wmax and wmin represent the boundaries the inertia value is confined to and tmax represents the maximum running time of the algorithm. w(t) = wmax −wmax −wmin tmax ∗t(24) To efficiently construct this algorithm, stopping criteria have to be properly defined. As shown in equation (24) defined by the tmax variable, one way to define the end of the algorithm is by defining a maximum number of time steps or iterations. If no other stopping criteria is defined, the algorithm will only stop when this maximum number of iterations independently of whether or not the global optimum was reached. It is then important to accurately define the dimension of tmax. A value that is too small will make the algorithm never find the best solution and on the other hand a value that is too big can result in wasted computational effort if the algorithm finds a local optimum from which it cannot escape. Some attempts to reduce this 15
In order to attempt to accelerate this escape, we propose a new approach where we select a single layer of the model and improve it using PSO. 3.1 Models In this thesis we will work with three different models, two of which are custom made and the third is the extensively used ResNet18 model ([8, 55, 56, 57, 58]). The first of the three models was named SimpleNet. Inspired by the LeNet‐5 [59] with modifications to support 3 color channels as well as increased neuron numbers, this model consists of a first block of two convolutional ‐ batch normalization pairs with a maximum pooling layer in between, followed by a linear block consisting of 3 linear layers as shown in Figure 9. The choosen activation function was the ReLu. The following model we will work with will be a reduced version of ResNet18 Figure 9: SimpleNet Architecture which we will call by ReducedResNet. This model is similar to its parent ResNet but with one less convolutional block. Finnaly we will also test the ResNet model with 18 layers (ResNet18), as shown in Figure 10, to allow us to better understand the behaviour PSO algorithms have on models with proven results in the literature. 22
Figure 10: ResNet Architecture (Source: [8]) 3.2 Pre‐training models As stated before the first objective of the work is to train the models from scratch until a plateau in performance (i.e. validation loss) is hit. To do this, we will perform a number of experiments to empirically find an iteration size sufficient so that the improvement both in accuracy and loss stagnates. Two gradient descent based algorithms will be tested to perform this optimization, SGD and ADAM. Furthermore, we will also perform tests with three different learning rate levels in order to achieve the best validation loss possible without dedicating too much time tuning the parameters for this stage. 3.3 Layer Selection After the model is trained we move onto selecting the layer that will be further optimized. We will consider two approaches to achieve this, a pruning based technique and the selection of the linear layer closest to the output. 3.3.1 Pruning selection Several research papers have focused on reducing neural network size by removing specific nodes, connections, or entire layers. These approaches commonly use a method for weighting the importance of each layer or connection. In [24] the authors make use of batch normalization weights to complete this task, proceeding then to prune the neurons that are less important to 23
the network. We propose to use the same method to select our target layer, whilst keeping the network’s architecture. As explained in the paper, this approach is possibly the most effective way to learn scaling parameters since it uses existing neural network architecture and therefore negates any impact to the network’s performance. The implementation of this method in this thesis will follow what is described in [24] which uses L1 normalization as a sparsity‐induced penalty (a type of penalty that tends to create several zero valued weights) on scalars and subgradient descent (an optimization algorithm for optimizing nondifferentiable convex functions) as the optimization method for this L1 penalty term, as shown in (29). gt=gt−1+λ∗ |wt−1|(29) Here wand grefer to each batch normalization layer’s weights and gradients respectively, whilst the scale sparse rate (λ) serves as a weight between 0 and 1 that controls the importance of the scaling factors (the batch normalization weights, in this case). The final scaling factors of each layer will then be averaged in order to find the most important layers. 3.3.2 Classifier layer Since classifier layers in our models are not followed by batch normalization layers they get excluded from the pool of possible selected layers by the previous approach. Furthermore, classifier layer’s weights directly affect the output and therefore any change to them should result in a considerable change to the output. For these reasons, the layer selected from the previously mentioned pruning approach will be compared with the final classifier layer of each model in each experiment, allowing us to better understand the quality of the pruning selection method. 3.4 Layer Optimization After selecting the layer to be optimized we will study the behaviour of the PSO with inertia algorithm and compare it with gradient descent optimization on the same layer and on the whole model. This comparison will allow us to understand whether or not these have a better chance of thriving in this highly dimensional search space. Each algorithm will be given 15 iterations to improve upon the previous best validation loss. This value may seem low but the number of 24
individuals per population pushes us to limit iterations in order to seek positive results with a lower or similar computational budget. In order to be able to use PSO to optimize the target layer weights and bias, we need to select an enconding to represent these weights and bias as individuals in the swarm. There are three ways of encoding this information as described in [44]. Matrix encoding creates particles as matrices, keeping weights in the same form that is used in ANNs. Vector encoding flattens the weights matrices, creating a single vector that contains all weights and bias. Finally, binary enconding creates a binary string for all weights, which, when the number of weights is large, becomes very complex to encode and decode. When dealing with ANNs, the first two encoding strategies are often used. In this thesis the vector encoding strategy was implemented. Each optimization approach will start with an initial solution that will correspond to the last state of the weights and bias of the layer selected in the first pre‐training seed. Even though we realize the optimal approach would be to have each experiments run for m∗nseeds with mcorresponding to the number of seeds in the pre‐training phase and nto the number of seeds in the single‐layer phase, given the time and compute resource constraints we felt our approach enables us to explore more parameters. 3.4.1 Particle Swarm Optimization To study the best parameters for the PSO in this problem, we will first, define our baseline parameters for the PSO. Afterwards, each parameter will be tested with different values and its impact on results will be studied. Finally, the final parameter values will be defined and results presented. In our experiments we will be studying inertia, positional and velocity clamping, cognitive and social factors and population size. Each of these parameters can play an important role in the behaviour of the algorithm. According to the literature, inertia provides a key role in balancing exploration and exploitation. Its creators, Shi and Eberhart in [30], state that a large inertia value is conducive to a global search whilst a small one facilitates local search. Besides the original version where the inertia value remains constant, several improvements have been suggested that dynamically adapt inertia throughout the algorithm’s running time. When it comes to choosing a value as our baseline, we decided to select a value of 1.2. This high inertia value seems suited to our use case since it will increase our exploratory ability, which should allow us to leave the plateau the model starts in. The cognitive and social factors of the PSO algorithm will play a role in balancing the attraction to the particles own best position and the global best position of the swarm. As a 25
baseline value for these parameters, we choose the value 2 for both since on average it makes the weights on the social and cognitive factors be 1, according to [18]. This initial equilibrium between the two parameters will be a good starting point to understand the model’s behaviour and how it changes with variations in the balance of these factors. Initially, we will not bound the particles’ position or velocity, leaving both of these parameters to run free. During our experiments, however, we will test the effects that both positional and velocity bounding have on the behaviour and performance of the algorithm. For the positional bounding study, we will use a factor fthat will scale an lvariable, defined as the maximum absolute value of all dimensions of the initial particle’s position, to increase the particles’s search space. The boundaries will then become [−f∗l,f∗l]. Particles that leave the defined bounds will be randomized into the bounded space. Similarly, to control velocity, the variable vb is defined as the maximum absolute gradient of the initial solution. Particles will then be limited to the [−vb,vb] interval. Much like with the bounding experiment, a factor fwill then be added to scale this variable. Unlike positional bounding however, particles that accelerate past the maximum established velocity do not get completely randomized. Instead, much like is implemented in [28], particles maintain their original direction whilst the magnitude of their velocity gets shortened by the result of the f∗vb limit over the maximum absolute value of the velocity vector. Finally, in our baseline parameter set the population will start with 100 individuals which seems to be a widely used baseline value and sigma value will start at 0.2. 3.4.2 Single layer gradient based optimization As we stated above, we will also experiment with optimizing the selected layer with a gradient based algorithm. The optimization method chosen and its learning rate will be the same used in the pre‐training phase of the given model. For example, if the SGD optimizer with a learning rate of 0.01 is the best performer for ResNet18, then that is the configuration that will be used to optimize the chosen layer. It would be interesting to explore different parameter values or optimizers but given the resources available we felt it was best to leave this exploration for future works. 26
3.4.3 Performance Evaluation We will evaluate models and parameter sets through the use of the Cross‐Entropy loss function (30). We will also present results for accuracy although they wont be relevant towards the decisions we will make. L=− n ∑ t=i tilog(pi)(30) 3.4.4 Implementation and tools used For this dissertation, all code was written in Python and the pytorch module was used for the implementation of the DNNs. This module was selected over tensorflow due to the exposure that the module gives to components of the networks such as the calculated gradients throughout the training process. The ability to attach custom components to the layers with the concept of hooks was also instrumental in implementing the pruning layer selection process. 4 EXPERIMENTAL SETUP 4.1 Datasets In order to better evaluate the performance of the models, we selected four datasets with varying degrees of complexity. • MNIST dataset [60] which contains gray scale images with a shape of 28x28x1 of handwritten digits with 60000 training images and a test set of 10000. • FashionMnist dataset [61] which much like MNIST contains gray scale images with a shape of 28x28x1 of different clothes with 60000 training images and a test set of 10000. • CIFAR10 dataset [62] with 10 classes containing 6000 32x32x3 images of objects and animals. The training set has a size of 50000 and the test set 10000 • CIFAR100 [62], which contains 100 classes with 600 32x32x3 images each. This dataset is essentially an upscale of CIFAR10, containing 10 times more classes. 27
These datasets were choosen in order to provide our models with different levels of input complexity. The simpler Mnist dataset contains more clearly distinguishable numbers. The FashionMnist dataset introduces additional complexity in the images presented by having images with a less defined shape, CIFAR10 introduces color channels and CIFAR100 provides the models with more variability in the input. In the pre‐processing of these images we have resized both MNIST and FashionMnist to a size of 32 by 32 to keep layers with the same dimensions across datasets. Furthermore, images have been vertically flipped with a probability of 0.2 and each pixel was normalized with a mean and standard deviation of 0.5. 4.2 Pre‐training models After running some preliminary experiments we decided to allow every model 20 iterations (read epochs) for the pre‐training phase, to learn using three learning rates (0.01, 0.001 and 0.0001) and two gradient based optimization methods, SGD and Adam. 4.3 Layer Optimization As described previously, we defined the following baseline parameter set: • Population: 100 • Inertia: 1.2 • Cognitive Factor: 2 • Social Factor: 2 • Sigma: 0.2 From this baseline we will then attempt to improve results by varying each parameter and analysing results. In total we will conduct 6 experiments: • Gradient based optimization experiment: Compares baseline results with optimizing the target layer with the same optimization method used in pre‐training for the given model • Inertia experiment: Experiments with lower inertia values of 0.5 and 0.9. 28
• Particle positional bounding: Explores how the algorithm behaves when its particles have a more restricted search space • Particle velocity bounding: Has the same intent has the positional bounding experiment but with velocity • Population experiment: Compares baseline population value of 100 with a lower (50) and higher (150) values. • Cognitive and Social factors experiment: Experiments with a 3 to 1 and 1 to 3 ratio between cognitive and social factors. To characterise the behaviour of each parameter set throughout the experiments we will be capturing several metrics. From the best individual we will capture the training and validation loss of each seed, calculating its average and standard deviation. From the population we will also monitor the average and standard deviation of training loss as well as the step size defined as the absolute median of the velocity vectors of the individuals. Further more we will also monitor information about whether the best solution changed and whether the particles start going out of positional and velocity bounds. In summary, per iteration we monitor the following metrics: • Best individual training loss • Best individual validation loss • Averaged population training loss • Standard deviation of the population training loss • Average population step size • Standard deviation of population step size • Total number of dimensions in the individuals position that go out of bounds • Total number of dimensions in the individuals velocity that go out of bounds • Whether the best solution changed (1 or 0) From each of these data points we then calculate the average and standard deviation per seed. 29
5 RESULTS 5.1 Pre‐training models As previously stated, we started this phase by allowing every model 20 iterations to learn using three learning rates (0.01, 0.001 and 0.0001). Every model was also tested with two different optimization methods: Adam and SGD. After running the experiment with 5 different seeds the result were as shown in Table 1. Dataset Best Model Lr Optimizer Best Loss Best Acc MNIST ResNet18 0,0001 Adam 0,03781 99% FashionMNIST ResNet18 0,001 Adam 0,25633 91% CIFAR10 ReducedResNet 0,001 Adam 0,76917 74% CIFAR100 ReducedResNet 0,001 Adam 2,05603 46% Table 1: Best average validation loss and accuracy per dataset Optimizer Lr SimpleNet ReducedResNet ResNet18 Adam 0,0001 1,4262 1,1496 1,4490 Adam 0,001 1,6021 1,1552 1,1582 Adam 0,01 1,3693 1,0281 1,3338 SGD 0,0001 2,6553 2,4279 1,9467 SGD 0,001 2,0035 1,8285 1,4897 SGD 0,01 1,3774 1,2376 1,3086 Table 2: Best overall average validation loss As expected, both accuracy and loss results show that, as datasets become increasingly complex, accuracy decreases. However, unexpectedly, the ResNet18 model was outperformed by the simpler ReducedResNet in the CIFAR100 dataset. This result is even more pronounced when using the learning rate of 0.001. When we observe the evolution of loss per iteration in both CIFAR10 and CIFAR100 datasets, we can see that the ResNet’s performance decreases when it reaches iteration 8. Given the results presented, we decided to move forward to the next phase with the Adam optimized version of the models and with the 0.01 and 0.001 learning rates. These selections were made based on the average loss of each model, optimizer and learning rate combination across all datasets, as seen in Table 2. For the SimpleNet and ReducedResNet we will 30
Figure 11: Average validation loss in pre‐training with best parameters 31
CIFAR100 Finally, in the CIFAR100 dataset, the models are confronted with a number of classes ten times higher. As previously stated, model performance in this dataset after the pre‐training phase was at 2.802, 2.536, 2.42 and 30, 34, 39% for SimpleNet, ReducedResNet and ResNet18 respectively. The linear layer of the SimpleNet model starts with a higher validation loss of about 3.285 and remained around this value throughout training. On the other hand the convolutional layer started lower at 3.21 but degraded to 3.33 (Figure 22). On all metrics the behaviour of the model in this environment was similar to what was observed in the previous datasets, with an exponential increase in step size and a growing training loss of the population. Figure 20: Average validation loss of SimpleNet in CIFAR100 On the ReducedResNet model the linear layer started at 2.45 and degraded to 2.56 and the convolutional layer started at 2.40 and degraded to 2.62. In the ResNet18 model, both linear and convolutional layers performed very similarly maintaining an validation loss close to 2.59 and 2.58 for the linear and convolutional layer respectively. Furthermore both layers had very low standard deviation per seed and similar standard deviation per individual on each population. On both these models we clearly see a decrease in standard deviation of the validation loss Overall, results were unsatisfactory. In the SimpleNet and ResNet18 models in particular, differences between the two layers were very stark with one layer remaining in a stable state throughout iterations while the other degrades. The layer that degrades, whether it is convolutional or the linear layer seems to depend on the model. The reason for this behaviour, we believe, may be related to two factors. The first one has to do with the layer selection. In 38
Figure 21: Average validation loss of ReducedResNet in CIFAR100 Figure 22: Average validation loss of ResNet18 in CIFAR100 each model, the PSO’s behaviour will be more transparent, when applied to a layer with higher importance, which in this experiment seems to be the case for the second convolutional layer in the SimpleNet and the linear layer of the ResNet18. As for the ReducedResNet model the chosen convolutional and linear layer choosen seem to have the same impact on model performance with exception to the FashionMNIST case where the linear layer is clearly much more impactful. The second factor is also related to the layer selected but with respect to the step size. Each layer will have a step size with varying magnitudes, which means that the difference of the step size in the pre‐training and the training phase may vary a lot between layers in the same model. As is demonstrated in Figure 23. When looking at the changes in the best solution we can see a clear increase in activity in later iterations, which seems to be partially related to the exponential growth of step size as shown in Figure 24. In this image we can see a comparison between a normalized average 39
Figure 23: Relation between step size and fraction of seeds that changed best solution per iteration step size against the averaged fraction of seeds where the best solution changes per iteration aggregated across all datasets, models and layers. Figure 24: Relation between step size and fraction of seeds that changed best solution per iteration Along with this increase in step size we also observe an exponential increase in the mean training loss of the population, particularly high in the linear layer of the SimpleNet as seen in Figure 25. Finnaly, after analyzing how much impact changing the best solution has on validation loss, we conclude that, changing the best solution, on average, guarantees a smaller degradation of performance. In the FashionMnist dataset validation loss increases on average 0.032682 when there is no change to the best solution, compared with a insignificant increase of 0.0007 when there is. On the other datasets, Cifar10 and Cifar100, we find that changing the best solution guarantees, on average, an even smaller degradation or even an improvement in validation 40
Figure 25: Population mean training loss 41
Figure 26: Change in loss with and without best solution change loss, as seen in Figure 26 Overall, the total average across datasets came to a degradation of 0.046921 when there was no change to the best solution against a slight improvement of 0.0006 when there was. It is worth noting, however, that after the first iterations, usually the PSO keeps changing the best solution, meaning that we have more data available for situations when the best solution changes. Despite not being conclusive, these results seem to indicate that our hypothesis that the main driving factor of degradation was the change of the best solution to solutions with much worse validation loss was incorrect. 5.3.2 Single layer gradient optimization In order to compare different optimization strategies, as well as to better understand the impact that the choice of the layer has on results, we studied the performance of optimizing the chosen layer with the gradient based optimizer selected in the pre‐training phase for each model, the results of which we present in the following section. FashionMnist In this dataset the Adam optimization of a single layer worked surprisingly well, particularly with the convolutional layers. When applied to the SimpleNet model the gradient based optimization managed to improve model performance by 4% to 0.305 validation loss in the convolutional layer. In the ReducedResNet model the convolutional layer had similar performance gains with an improvement of 9.9% to a loss of 0.249 and the linear layer showed better performance by improving its validation fitness to 0.264, a percentage improvement of 4.3%. Lastly, 42
ResNet18 showed a 1.8% improvement with the convolutional layer as shown in Table 4. It is worth noting that the improvements observed were mostly achieved in the first iteration, with small gains in performance observed throughout the rest of the iterations,the exception being the ResNet18 model which showed a continued improvement throughout the iterations (Figure 27). 43
Model Layer Experiment Best Validation Diff to pre‐training Diff to pre‐training (%) ReducedResNet layer2.0.conv2 Adam optim 0,249 ‐0,027 ‐9,9 ResNet18 layer4.0.downsample.0 Adam optim 0,255 ‐0,005 ‐1,9 ReducedResNet fc Adam optim 0,265 ‐0,012 ‐4,3 ResNet18 fc Adam optim 0,267 0,007 2,6 ResNet18 layer4.0.downsample.0 Standard 0,278 0,018 6,8 ResNet18 fc Standard 0,295 0,035 13,6 SimpleNet conv2 Adam optim 0,305 ‐0,013 ‐4,0 ReducedResNet fc Standard 0,312 0,035 12,7 ReducedResNet layer2.0.conv2 Standard 0,317 0,041 14,8 SimpleNet fc3 Adam optim 0,334 0,016 5,0 SimpleNet conv2 Standard 0,344 0,026 8,2 SimpleNet fc3 Standard 0,349 0,031 9,8 Table 4: Single Layer Optimization results 44
Figure 27: Best validation loss of single layer gradient optimization CIFAR10 On the CIFAR10 dataset, improvements were only observed in the SimpleNet and ReducedResNet model. In the first, only the convolutional layer was able to improve performance by 1.5% whilst with the linear layer performance degraded by 1.77%, underperforming the baseline result. On the ReducedResNet results were better with a 6.28 and 2,84% improvement in the convolutional and linear layer respectively. Finally on the ResNet18 model both layers were not able to improve performance. CIFAR100 Of the three datasets, the CIFAR100 dataset showed the worst results for this experiment, with performance improving only in the ReducedResNet model. Here the convolutional layer improved model performance by 5.22% to 2.123 loss and the linear layer showed a 2.71% improvement. Overall, using gradient based optimization on a single layer seems to yield reason‐ 45
ably good results. Improvements in validation loss were achieved in several situations which also allows us to confirm that improvement of the model with a single layer being optimized is possible. We also found that in situations where the model was in degradation, such as the ResNet18 in the CIFAR100 dataset, using a gradient based algorithm on a single layer reversed this trajectory when applied to the correct layer. In our experiment, the linear layer showed a similar behaviour to what the full model optimization had shown but when optimizing the convolutional layer the model stabilized performance, as shown in Figure 28. Figure 28: Adam optimizer on ResNet18 in Cifar100 The results of this experiment also showed that the pruning method to select an optimization layer seems to have led to better results then the classifier layers as shown in Figure 29. Figure 29: Average % improvement over best validation in pre‐training 46
5.3.3 Inertia As described previously, inertia, much like momentum in gradient based algorithms determines how much of the previous direction vt−1gets carried to the next iteration vt. A higher value will then prevent tight turns and makes the algorithm less random. In this experiment we tested the PSO with two lower values of inertia 0.5 and 0.9 and, as expected in both cases, step size increased in a much more controlled fashion as shown in Figure 30. Figure 30: Average step size in the FashionMnist dataset Another positive result of reducing the inertia value was that the degradation of the average training loss of the population was significantly reduced as we can see in Figure 31. These results on step size and average validation loss were manifested in every dataset and for all models. However, the best validation loss did not have any relevant improvements overall when compared with the baseline inertia values. A possible reason for this failure to improve might be related to the size of the steps being taken. Despite their explosion in later iterations being more under control when reducing the inertia values, they are still significantly bigger then the values the gradient based approach presents. 5.3.4 Positional Bounding Experiments in positional bounding usingfvalues of 1 and 2 (identified as DBounds and DBounds2 respectively) did not show any improvement in the validation loss of the models. As shown in Figure 32, we witnessed some success in containing the degradation of the performance in models, however, at the same time, this boundary definition approach proved to be very volatile and 47
of the optimization process. Finally, several hybrid PSO approaches could be tested with this single layer optimization. 6 CONCLUSION In conclusion, the use of the PSO algorithm to perform weight optimization of DNNs appears to be very ineffective, particularly in the higher dimensional spaces. In our baseline experiments, it was immediately noticeable that the PSO algorithm was not able to improve upon the results the regular gradient based optimization had achieved up until iteration 20. At best, this approach made no significant change to the validation loss and at worst a steep performance degradation was observed. In this first experiment we also provided evidence to reject our hypothesis that the replacement of the best solution inherent to the behaviour of the PSO, was not harming the optimization of the validation loss. Additionally, after reviewing the step size charts resulting from this trial we found that the step size was exploding throughout the training of the models. With these findings, we came to the conclusion that these behaviours are linked to the step size. This statement is backed by the observation that, when comparing the same neural network in the same dataset, the layer on which the PSO had a higher step size would always show higher performance degradation. Furthermore we found no relation between dimensionality and performance since this degradation occurred regardless of whether the degrading layer had a higher or lower number of dimensions. However, we did see a decrease in the ability of the PSO to change the validation loss in environments with higher complexity. Our experiments with positional bounding showed this approach to be extremely volatile. Positional bounds that were set too tight made every movement of the particle go out of bounds and be randomly reset. Furthermore, defining the positional bounds in relation to the initial solution led to boundaries that varied substantially which led to very inconsistent results across the datasets and models. Finally, experiments with velocity bounding showed the best results of all our experiments so far. This approach showed great success in mitigating the step size explosion as well as reducing degradation across datasets and models. Further work can be done on improving how the values are set so that the movement of particles is not too restricted and the PSO can 54
still express itself. Looking at the effects of population size on the performance of the PSO we reached the conclusion that a lower population had better results on most settings. However, when analyzing the best population size per dimension we also found that population size and layer dimensions are correlated with one another. Given these results we believe that the values of population size used in our experiment could possibly not be differenciable enough for us to see the true effects of bigger populations on results. On the other hand, a higher number of individuals increases the computational cost of the approach which leads us to recommend that population size be adjusted in relation to the maximum number of iterations that a use case allows for. After experimenting with the inertia values we found that, as expected, by reducing the inertia value, the exponential growth in step size previously observed was significantly reduced. However, validation loss did not show improvements over the results achieved in pre‐training. The lower inertia value of 0.5 performed well across models and layers in the FashionMnist dataset, whilst the standard 1.2 and 0.9 values performed well on the CIFAR10. In the CIFAR100 dataset inertia showed very little impact in validation loss, with all variations performing very similarly to one another. Moving forward, a possible approach to take would be to combine an adaptive inertia with a less restrictive velocity clamping method. Finally, balancing the cognitive and social factors in different combinations also seemed to make no direct impact on the performance of the PSO, with bigger variations in results apparently being related to changes in the scale of the step size. Moving on to the single layer gradient descent optimization experiment, the results showed us a marked improvement over our baseline PSO approach. With this gradient based method, we were able to improve the best validation loss in several environments, particularly when working with the FashionMnist dataset. Of note was the performance of this method when applied to the layer selected by our pruning techinique which showed improvements on SimpleNet and ResNet18 regardless of the dataset considered. Furthermore the importance of the layer selection can be seen particularly in the CIFAR100 dataset with the ResNet18 model in which the linear layer degraded along the fully trained model but the convolutional layer reversed the trajectory and showed improvements on validation loss. To conclude, although the PSO algorithm was not successful in improving validation loss, we believe the layer selection method presented can be further explored, given the results 55
obtained in conjunction with the single layer gradient based optimization, as an approach to speed up the improvement of validation loss in DNN training. 56
7 BIBLIOGRAPHY [1] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning . MIT Press, 2016. http://www.deeplearningbook.org. [2] Nicola Fronzetti. Predictive neural network applications for insurance processes, 09 2019. [3] Wilson Wongwe. Multimodal‐fitness‐landscape. http://www.wilsonmongwe.co.za/understandingthe‐em‐algorithm/multimodal‐fitness‐landscape/, 2015. [4] Abiel Aguilar‐González, Miguel Arias‐Estrada, Madain Perez‐Patricio, and Jorge camas anzueto. An fpga 2d‐convolution unit based on the caph language. Journal of Real‐Time Image Processing , 04 2019. [5] Comparison between a normal and a residual block. https://d2l.ai/chapter_convolutional‐ modern/resnet.html. [6] Beatriz A. Garro, Humberto Sossa, and Roberto A. Vazquez. Design of artificial neural networks using a modified particle swarm optimization algorithm. In 2009 International Joint Conference on Neural Networks , pages 938–945, 2009. [7] Serkan Kiranyaz, Turker Ince, Alper Yildirim, and Moncef Gabbouj. Evolutionary artificial neural networks by multi‐dimensional particle swarm optimization. Neural networks : the official journal of the International Neural Network Society , 22:1448–62, 07 2009. [8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR , abs/1512.03385, 2015. [9] Douglas B. Lenat and R. V. Guha. Building Large Knowledge‐Based Systems; Representation and Inference in the Cyc Project . Addison‐Wesley Longman Publishing Co., Inc., USA, 1st edition, 1989. [10] Ning Qian. On the momentum term in gradient descent learning algorithms. Neural Networks , 12(1):145 – 151, 1999. [11] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research , 12:2121–2159, 07 2011. [12] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR , abs/1412.6980, 2014. 57
[13] Angela H. Jiang, Daniel L.‐K. Wong, Giulio Zhou, David G. Andersen, Jeffrey Dean, Gregory R. Ganger, Gauri Joshi, Michael Kaminsky, Michael Kozuch, Zachary C. Lipton, and Padmanabhan Pillai. Accelerating deep learning by focusing on the biggest losers. CoRR , abs/1910.00762, 2019. [14] Jeremy Bernstein, Yu‐Xiang Wang, Kamyar Azizzadenesheli, and Anima Anandkumar. signsgd: compressed optimisation for non‐convex problems. CoRR , abs/1802.04434, 2018. [15] Tyler B Johnson and Carlos Guestrin. Training deep models faster with robust, approximate importance sampling. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa‐Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems , volume 31. Curran Associates, Inc., 2018. [16] B. Rylander M. Cells. Neural network learning using particle swarm optimizers. Advances in Information Science and Soft Computingg; WSEAS Press: Cancun, Mexico; , page 224–226, 2002. [17] E. T. Oldewage. The perils of particle swarm optimization in high dimensional problem spaces. 2017. [18] R. Eberhart and J. Kennedy. A new optimizer using particle swarm theory. In MHS’95. Proceedings of the Sixth International Symposium on Micro Machine and Human Science , pages 39–43, 1995. [19] A. CAUCHY. Methode generale pour la resolution des systemes d’equations simultanees. C.R. Acad. Sci. Paris , 25:536–538, 1847. [20] B.T. Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics , 4(5):1–17, 1964. [21] Y. Nesterov. A method for unconstrained convex minimization problem with the rate of convergence o(1/k2). 1983. [22] Matthew D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR , abs/1212.5701, 2012. [23] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR , abs/1502.03167, 2015. 58
[24] Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. 2017. [25] Craig W. Reynolds. Flocks, herds and schools: A distributed behavioral model. SIGGRAPH Comput. Graph. , 21(4):25–34, August 1987. [26] E. Azadani, Seyed Hossein Hosseinian, and Poria Hasanpor. Optimal placement of multiple statcom for voltage stability margin enhancement using particle swarm optimization. Electrical Engineering , 90:503–510, 09 2008. [27] Y. Del Valle, J.C. Hernandez, G.K. Venayagamoorthy, and R.G. Harley. Multiple statcom allocation and sizing using particle swarm optimization. In 2006 IEEE PES Power Systems Conference and Exposition , pages 1884–1891, 2006. [28] Elre T. Oldewage, Andries P. Engelbrecht, and Christopher W. Cleghorn. The merits of velocity clamping particle swarm optimisation in high dimensional spaces. In 2017 IEEE Symposium Series on Computational Intelligence (SSCI) , pages 1–8, 2017. [29] Adam P. Piotrowski, Jaroslaw J. Napiorkowski, and Agnieszka E. Piotrowska. Population size in particle swarm optimization. Swarm and Evolutionary Computation , 58:100718, 2020. [30] Y. Shi and R. Eberhart. A modified particle swarm optimizer. In 1998 IEEE International Conference on Evolutionary Computation Proceedings. IEEE World Congress on Computational Intelligence (Cat. No.98TH8360) , pages 69–73, 1998. [31] Karin Zielinski and Rainer Laur. Stopping criteria for a constrained single‐objective particle swarm optimization algorithm. Informatica (Slovenia) , 31:51–59, 03 2007. [32] Mingquan Chen. Second generation particle swarm optimization. In 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence) , pages 90–96, 2008. [33] Rui Mendes, James Kennedy, and João Neves. The fully imformed particle swarm: Simpler, mabe better. Evolutionary Computation, IEEE Transactions on , 8:204 – 210, 07 2004. [34] J.J. Liang, A.K. Qin, P.N. Suganthan, and S. Baskar. Comprehensive learning particle swarm optimizer for global optimization of multimodal functions. IEEE Transactions on Evolutionary Computation , 10(3):281–295, 2006. [35] Zhi‐Hui Zhan, Jun Zhang, Yun Li, and Yu‐hui Shi. Orthogonal learning particle swarm optimization. IEEE Trans. Evolutionary Computation , 15:832–847, 12 2011. 59
[36] Yue‐Jiao Gong, Jing‐Jing Li, Yicong Zhou, Yun Li, Henry Shu‐Hung Chung, Yu‐Hui Shi, and Jun Zhang. Genetic learning particle swarm optimization. IEEE Transactions on Cybernetics , 46(10):2277–2290, 2016. [37] Nandar Lynn and Ponnuthurai Suganthan. Ensemble particle swarm optimizer. Applied Soft Computing , 55, 02 2017. [38] Beatriz A. Garro and Roberto A. Vazquez. Designing artificial neural networks using particle swarm optimization algorithms. Intell. Neuroscience , 2015, 01 2015. [39] Chunkai Zhang, Huihe Shao, and Yu Li. Particle swarm optimisation for evolving artificial neural network. 4:2487–2490 vol.4„ 2000. [40] C. Zhang and H. Shao. An ann’s evolved by a new evolutionary system and its application. In Proceedings of the 39th IEEE Conference on Decision and Control (Cat. No.00CH37187) , volume 4, pages 3562–3563 vol.4, 2000. [41] Bin Wang, Yanan Sun, Bing Xue, and Mengjie Zhang. Evolving deep convolutional neural networks by variable‐length particle swarm optimization for image classification. In 2018 IEEE Congress on Evolutionary Computation (CEC) , pages 1–8, 2018. [42] L. L. Custode, C. L. Tecce, I. Bakurov, Mauro Castelli, A. Della Cioppa, and Leonardo Vanneschi. A greedy iterative layered framework for training feed forward neural networks. pages 513–529, 4 2020. [43] Wei‐Zhen Lu, Huiyuan Fan, and S Lo. Application of evolutionary neural network method in predicting pollutant levels in downtown area of hong kong. Neurocomputing , 51:387–400, 01 2003. [44] Jing‐Ru Zhang, Jun Zhang, Tat‐Ming Lok, and Michael R. Lyu. A hybrid particle swarm optimization–back‐propagation algorithm for feedforward neural network training. Applied Mathematics and Computation , 185(2):1026–1037, 2007. Special Issue on Intelligent Computing Theory and Methodology. [45] Jeng‐Fung Chen, Quang Hung Do, and Ho‐Nien Hsieh. Training artificial neural networks by a hybrid pso‐cs algorithm. Algorithms , 8:292–308, 06 2015. [46] Tae‐Young Kim and Sung‐Bae Cho. Particle swarm optimization‐based cnn‐lstm networks for forecasting energy consumption. In 2019 IEEE Congress on Evolutionary Computation (CEC) , pages 1510–1516, 2019. 60
[47] K. O. Stanley and R. Miikkulainen. Efficient evolution of neural network topologies. In Proceedings of the 2002 Congress on Evolutionary Computation. CEC’02 (Cat. No.02TH8600) , volume 2, pages 1757–1762 vol.2, 2002. [48] David J. Montana and Lawrence Davis. Training feedforward neural networks using genetic algorithms. In Proceedings of the 11th International Joint Conference on Artificial Intelligence ‐ Volume 1 , IJCAI’89, page 762–767, San Francisco, CA, USA, 1989. Morgan Kaufmann Publishers Inc. [49] Yong Liang, Kwong‐Sak Leung, and Zong‐Ben Xu. Neural network training using genetic algorithm with a novel binary encoding. In Derong Liu, Shumin Fei, Zengguang Hou, Huaguang Zhang, and Changyin Sun, editors, Advances in Neural Networks – ISNN 2007 , pages 371–380, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg. [50] Parsa Esfahanian and Mohammad Akhavan. Gacnn: Training deep convolutional neural networks with genetic algorithm, 2019. [51] Hyeyoung Park, Masato Inoue, and Masato Okada. Learning dynamics of neural networks with singularity – standard gradient vs. natural gradient. volume 3157, pages 282–291, 09 2004. [52] Mark Ainsworth and Yeonjong Shin. Plateau phenomenon in gradient descent training of relu networks: Explanation, quantification and avoidance. CoRR , abs/2007.07213, 2020. [53] K. Fukumizu and S. Amari. Local minima and plateaus in hierarchical structures of multilayer perceptrons. Neural Networks , 13(3):317–327, 2000. [54] Weili Guo, Yuan Yang, Yingjiang Zhou, Yushun Tan, Haikun Wei, Aiguo Song, and Guochen Pang. Influence area of overlap singularity in multilayer perceptrons. IEEE Access , 6:60214– 60223, 2018. [55] Bohan Zhuang, Chunhua Shen, and Ian D. Reid. Training compact neural networks with binary weights and low precision activations. CoRR , abs/1808.02631, 2018. [56] A. Ebrahimi, S. Luo, and R. Chiong. Introducing transfer learning to 3d resnet‐18 for alzheimer’s disease detection on mri images. In 2020 35th International Conference on Image and Vision Computing New Zealand (IVCNZ) , pages 1–6, 2020. [57] Tawsifur Rahman, Muhammad E. H. Chowdhury, Amith Khandakar, Khandaker R. Islam, Khandaker F. Islam, Zaid B. Mahbub, Muhammad A. Kadir, and Saad Kashem. Transfer 61
learning with deep convolutional neural network (cnn) for pneumonia detection using chest x‐ray. Applied Sciences , 10(9), 2020. [58] Piotr Szymak, Paweł Piskur, and Krzysztof Naus. The effectiveness of using a pretrained deep learning neural networks for object classification in underwater video. Remote Sensing , 12(18), 2020. [59] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient‐based learning applied to document recognition. Proceedings of the IEEE , 86(11):2278–2324, 1998. [60] Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist , 2, 2010. [61] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion‐mnist: a novel image dataset for benchmarking machine learning algorithms. CoRR , abs/1708.07747, 2017. [62] Alex Krizhevsky. Learning multiple layers of features from tiny images. University of Toronto , 05 2012. 62
Page | i