Intelligent gradient amplification for deep neural networks
Deep learning models offer superior performance compared to other machine
learning techniques for a variety of tasks and domains, but pose their own
challenges. In particular, deep learning models require larger training times
as the depth of a model increases, and suffer from vanishing gradients. Several
solutions address these problems independently, but there have been minimal
efforts to identify an integrated solution that improves the performance of a
model by addressing vanishing gradients, as well as accelerates the training
process to achieve higher performance at larger learning rates. In this work,
we intelligently determine which layers of a deep learning model to apply
gradient amplification to, using a formulated approach that analyzes gradient
fluctuations of layers during training. Detailed experiments are performed for
simpler and deeper neural networks using two different intelligent measures and
two different thresholds that determine the amplification layers, and a
training strategy where gradients are amplified only during certain epochs.
Results show that our amplification offers better performance compared to the
original models, and achieves accuracy improvement of around 2.5% on CIFAR- 10
and around 4.5% on CIFAR-100 datasets, even when the models are trained with
higher learning rates.
Sunitha Basodi, Krishna Pusuluri, Xueli Xiao, Yi Pan
# Intelligent gradient amplification for deep neural networks.

###### Abstract

Deep learning models offer superior performance compared to other machine learning techniques for a variety of tasks and domains, but pose their own challenges. In particular, deep learning models require larger training times as the depth of a model increases, and suffer from vanishing gradients. Several solutions address these problems independently, but there have been minimal efforts to identify an integrated solution that improves the performance of a model by addressing vanishing gradients, as well as accelerates the training process to achieve higher performance at larger learning rates. In this work, we intelligently determine which layers of a deep learning model to apply gradient amplification to, using a formulated approach that analyzes gradient fluctuations of layers during training. Detailed experiments are performed for simpler and deeper neural networks using two different intelligent measures and two different thresholds that determine the amplification layers, and a training strategy where gradients are amplified only during certain epochs. Results show that our amplification offers better performance compared to the original models, and achieves accuracy improvement of \(\sim\)2.5% on CIFAR-10 and \(\sim\)4.5% on CIFAR-100 datasets, even when the models are trained with higher learning rates.
keywords: Deep learning, gradient amplification, CIFAR, backpropagation, learning rate, training time +
Footnote †: journal: Computer Science and Technology

## 1 Introduction

Deep learning models have produced results comparable or sometimes superior to human experts in many interdisciplinary applications[1; 2; 3; 4; 5]. Performance of these models generally improves with increasing depth of the network [6], but some challenges arise such as vanishing gradients and high training time even on parallel computational resources [6]. There are many architectures [7] that work well for a wide range of applications but even the simplest models are computationally intensive. As there are millions of model parameters for each set of hyper parameters, deep neural networks are slow to train, sometimes ranging from several days or weeks depending on the model architecture, dataset size, and hardware resources. One way to improve the training time is to do this in parallel using Graphical Processing Units(GPUs), or Tensor Processing Units(TPUs), or on parallel distributed systems. The other way to further improve is to train the model with higher learning rates or large batch sizes. Employing larger learning rates can speedup the training process by quickly converging to local optima, but they can often miss the global optima, resulting in sub-optimal solutions or sometimes non-convergence [8]. Lower learning rates converge better to optima, but have larger training times. In general, a combination of higher and lower learning rates are employed, using scheduling schemes or algorithms which adaptively reduce the learning rates over epochs. There have been multiple efforts to analyze and modify gradients and learning rates dynamically during the training process, but there is no detailed analysis on the impact of the modification factor on model performance. Vanishing gradients [9; 10; 11] is another problem that can occur while training deep neural networks. Some approaches help to mitigate this issue, such as weight initialization followed by fine-tuning with backpropagation [12], using Rectified Linear Unit (ReLU) activation function [13; 14], or applying batch normalization (BN) [15]. In addition, advancements in hardware capablities of GPUs such as double precision help overcome this issue to some extent while training deep neural networks.

Though there have been efforts to address the above mentioned problems independently, there have been minimal efforts to identify an integrated so
lution to improve the performance of the model by addressing both vanishing gradients and accelerating the training process by achieving higher performance at larger learning rates. To improve the training process of existing deep learning models, we propose an intelligent gradient amplification approach, along with a training strategy that analyzes the net gradient change of a layer in an epoch. While performing gradient amplification, gradients are dynamically increased for some layers during back propagation using a training strategy where amplification is performed for a few epochs, while the model is trained without gradient amplification for the remaining epochs. Neural networks trained using our method have improved testing and training accuracies, even at higher learning rates (thereby reducing the overall training time).

In this work, we extend the gradient amplification method proposed in [16] using a formulated approach by analyzing the fluctuations of gradients within and across layers during training, and intelligently identifying the layers to perform gradient amplification. Our contributions include the following:

* We propose two measures to compute the effective gradient update direction of each layer, which are independently analyzed by performing normalization.
* We suggest two thresholding approaches to intelligently identify the layers to amplify, one when the actual normalized measure of a layer crosses the threshold and the other when the absolute normalized measure is beyond the threshold.
* We study the impact of thresholds by analyzing a wide range of values and identify threshold values that could generally work for a deep learning model.
* We perform detailed experiments using two intelligent measures with two thresholding approaches applying a training strategy where gradients are amplified during certain epochs and the model is trained in the remaining epochs without amplification.

The remainder of this paper is organized as follows. Related works are briefly described in Section 2. Our amplification method with proposed measures and thresholding approaches is presented in Section 3. Experimental
setup, results, and their comparisons are discussed in Section 4 and 5, followed by conclusions in Section 6.

## 2 Related Work

Although deep learning models are robust and acheive better performance, there are several areas where these models could be improved further. Designing new architectures, automatic tuning of network hyperparameters, improving training time of the models, designing efficient functions (activation, kernal and pooling are some of such challenges[17; 18; 19]. In this section, we briefly discuss the existing approaches to address vanishing gradient problem, reduce the training time of deep learning models, and study the impact of learning rates.

### Vanishing gradients

The problem of vanishing gradients [9; 10; 11] occurs in gradient-based learning methods while training models with backpropagation. As the network weights get updated based on the gradients during back-propagation, lower gradient values cause the network to learn slowly and the value of these gradients reduces further while propagating from end layers to initial layers of the network. When gradients are close to 0, a model cannot learn while training and the weight updates do not have any effect on its performance. Though there is no direct solution for this issue, several methods suggested in the literature [20] help to mitigate the issue. One of the early proposed method [12] involves a two step weight update rule, where, network weights are updated based on unsupervised learning methods and then fine-tuned using supervised learning with back-propagation. In recent years, with the introduction of ReLU activation function [13; 14], batch normalization(BN)[15] and Resnet networks[21], this problem reduced further. When a model has ReLU activation function[13; 14], only positive inputs get propagated in the forward pass, it is observed from experiments that the gradients in the backward pass do not diminish and prevents vanishing gradients to some extent. The other approach is to use BN[15] layers in a model. These layers normalize the inputs to reduce its variance during the forward pass and therefore help in regulating the gradients in the backward pass during training. One can use both ReLU activation layer and BN layer in a network, improving the performance of the model even further while training. Resnet networks use these combination of layers in addition to other layers and also have residual
connection in the network, connecting some initial residual blocks(or layers) to the later residual blocks(or layers). Since the gradients also get directly propagated with these connections to the initial layers in addition to the network layers, the problem of vanishing gradients reduces even futher. In addition to these approaches, with the constant advancement in the hardware and their increased computation abilities, the problem has further reduced. In out method, as we increase the gradients of some of the layers of the network during backpropagation, it helps to aid the problem of vanishing gradients.

### Learning rates

Learning rate is one of the critical hyperparameters that directly influences the performance of the deep learning models. Models can be trained faster with larger learning rates, but can lead to sub-optimal solutions. Using lower learning rates converges the models better with optimal solutions [8] but has long training times. There are many approaches designed to achieve better performance using a combination of these learning rates. Learning rate scheduler is one such ways, where the training begins with higher learning rates which is lowered as the training continues [22]. Lowering of learning rates in a scheduler can be designed in many ways [23], such as, assigning learning rates to epochs, gradually decaying the learning rate based on the current learning rate, current epoch and total number of epochs(time-based decay); reducing the learning rate in a step-wise manner after a certain number of epochs(step decay); and exponentially decaying the learning rate based on the initial learning rate and the current epoch(exponential decay). There are some other approaches suggested, such as, normalizing model weights while training with stochastic gradient descent to speed up the performance [24]. Authors of [25] increase batch size without decaying learning rates and observe that the models achieve similar test performances. Since this uses larger batch sizes, it increases parallelism and has fewer parameter updates thereby reducing the overall training times.

In general, while training a model with learning rate scheduler, higher learning rates used in the beginning for a few epochs, followed by lower of learning rates for the next few epochs; and this process is repeated until the desired optima or model performance is achieved. Some optimization algorithms automatically determine the learning rates with the epochs dynamically without the requirement of manual intervention. However, these methods also have some fallbacks and do not always converge to optimal
solutions. One way to improve the training speed is to develop methods to achieve optimal model parameters at larger learning rates.

#### 2.2.1 Adaptive learning rates for layers/neurons/parameters

Another approach to overcome identifying learning rate hyperparameters without need of any scheduling is by modifying learning rate dynamically based on the performance of the optimization algorithm. A few of such methods include Adagrad[26], Adadelta[27], RMSprop[28] and Adam [29]. There have also been several efforts to improve models with adaptive learning rates [30; 31; 32; 33; 34]. Ede et al. [35] control the gradients from being propagated when the expected loss is over a defined boundaries. This causes the learning rates to be dynamically addjuste during training. Paper [36] designs a controller to automatically manage learning rate by identifying informative features. Authors of [37] identify learning rates using reinforcement learning based approach by analyzing the training history. Experiments are performed on CIFAR-10 AND FMNIST database have improved performance emphasizing its advantages. You et al. [38] adaptively scale the learning rates of layers to improve the performance of models trained in large batches in parallel and perform experiments on AlexNet[39]. Paper [40] proposes a layer-wise adaptive learning rate computation by using layer weight dependent matching factor which is computed dynamically during training based on the layer type. Authors demonstrate the advantage of their method with mathematical equations and experimental results.

### Analysis of gradients

Gradients provide vital information on various aspects such as training progression, weight fluctuations, model convergence and so on. This information can be used to address vanishing/exploding gradients, accelerate the training process or dynamically modify learning rates while training the model. Some of the adaptive learning rate algorithms [26][27] mentioned above use the gradients of a few iterations to identify a suitable learning rate on the current iteration. Zhang et al. [40] scale the gradients of a layer based on a matching factor which is computed during training based on the weights and type of the layer.

## 3 Proposed Gradient Amplification Strategies

Gradient amplification with random selection of layers proposed in [16] has overhead of identifying the ratio of layers, the type of layers and the
combination of those types of layers. With the increase in number of layers and also with different types of layers, the network becomes deeper and it is challenging to determine the best amplified models of all the combinations. In this section, we aim to formulate a way to automatically determine the layers which need to be amplified.

### Effect of gradient amplification on learning rate

Here, we emphasize the relationship between learning rate and its effects on gradients while performing amplification. The general weight update formula during training of neural networks is shown below:

\[\mathbf{W}_{t+1}=\mathbf{W}_{t}+\eta\nabla J(\mathbf{W}_{t+1}) \tag{1}\]

where, \(\mathbf{W}_{t}\) represents the weights of a network in the current iteration \(t\), \(\eta\) is the learning rate and \(\nabla J(\mathbf{W}_{t+1})\) corresponds to the gradients of the weights computed as the derivative of error of cost function with respect to weights.

After performing gradient amplification, \(\nabla J(\mathbf{W}_{t+1})\) gets modified depending on the amplification factor. Let us denote the amplified gradient as

\[\nabla J_{amp}=amp*\nabla J(\mathbf{W}_{t+1}) \tag{2}\]

Therefore the weight update formula after gradient amplification can be written as:

\[\begin{gathered}\mathbf{W}_{t+1}=\mathbf{W}_{t}+\eta\nabla J_{amp}(\mathbf{W }_{t+1})\\ \mathbf{W}_{t+1}=\mathbf{W}_{t}+\eta*amp*\nabla J(\mathbf{W}_{t+1})\\ \mathbf{W}_{t+1}=\mathbf{W}_{t}+(\eta*amp)*\nabla J(\mathbf{W}_{t+1})\\ \mathbf{W}_{t+1}=\mathbf{W}_{t}+\eta_{amp}*\nabla J(\mathbf{W}_{t+1}),\ where \ \eta_{amp}=\eta*amp\end{gathered} \tag{3}\]

From the above analysis, one can conclude that amplifying gradients is equivalent to increasing learning rates. To determine the layers that need to be amplified, one approach is to identify the layers that learn actively during the training process. Authors of [41] propose a way to speedup the training process of deep learning models using layer freezing approach by determining the fluctuations of gradients in layers. Similar approach can be employed to determine the layers that are actively learning. As performing amplification is equivalent to increasing step size of weight updates, learning rate (or step
size) can be increased when the current weights of the neurons are relatively far from optima and their gradients are all moving in the same direction to converge to optima. In addition to determining the layers that are actively learning, it is also important that the gradients of the neurons in the layers are all moving in the same direction for the amplification to be meaningful. This can be formulated by analyzing the gradients of the neurons in a layer across iterations. One simple way to perform such an identification is to compute the sum of the gradient values over iterations for all neurons in a layer.

### Layer gradient directionality ratio measure, \(G\)

The effective direction of gradient change of the neurons in a layer \(l\) can be determined using the ratio of the sum of the gradients across different iterations to its absolute gradient sum in an epoch. Here, \(m\) and \(n\) correspond to the number of iterations in an epoch and the number of neurons(or weights) in a layer respectively.

\[G_{l}=\left\{\begin{array}{l}0,\ when\ \sum_{i}^{n}\sum_{j}^{m}|g_{ilj}|=0 \frac{\sum_{i}^{n}|\sum_{j}^{m}g_{ilj}|}{\sum_{i}^{n}\sum_{j}^{m}|g_{ilj}|},\ otherwise\end{array}\right. \tag{4}\]

The above formula determines how the weights in a layer are modified. When all the weight updates of the neurons occur in the same direction across all iterations, its value is 1. When either the model reaches optimal solution (where the gradient for every neuron becomes zero) or half of the neuron weights move in the opposite direction to the other half with same magnitude (ideal case) then the value becomes 0. Otherwise, it lies in between 0 and 1. Values close to 1 signify that most of the weights are changing in the same direction and vice versa.

\[0\leqslant G_{l}\leqslant 1 \tag{5}\]

### Normalized layer gradient directionality ratio measure, \(\hat{G}\)

After computing the _layer gradient directionality ratio (\(G_{l}\))_ for each layer in an epoch, it is observed that most of these values are in same range. To identify the most significant layers close to 1, _layer gradient directionality ratio (\(G_{l}\))_ of all the layers are converted to a normal distribution using :

\[\hat{G}=\frac{G-\overline{\mathrm{G}}}{\sigma_{G}} \tag{6}\]
These normalized values signify how far they lie from the mean value. If the normalized value of a layer is close to 0, then it lies close to the mean value, otherwise, its value signifies the magnitude of standard deviation(s) it is away from the mean value. Larger the positive(or negative) value farther it is from the mean. Since the range of \(Gl\) is \([0,1]\), when the normalized value is a large positive value (signifying farther from the mean on the right side), it can be considered closer to the 1 (in equation 5), where as large negative values can be considered close to 0 (in equation 5).

### Improved Layer gradient directionality ratio measure, \(G^{\prime}\)

The gradients of neurons of a layer lie in a similar range and the measure \(G\), which has the sum of all the gradients of neurons across all the iterations, gives more importance to the gradients values that occur frequently during the training. If equal importance is given to the all the neurons, then even if some of the ratio measures are close to 1, then the layer has relatively higher ratio value (closer to 1). In contrast, when the gradient changes for each neuron across multiple iterations are computed individually and are used for computing effective directionality of layer, all neurons then contribute equally towards the gradient direction change. With this modification, even if some of the neuron gradients in a layer are moving in the same direction, the layer still has an higher chance of being identified.

The effective direction of gradient change of the neurons in a layer \(l\) is therefore determined using the ratio of the sum of the gradients across different iterations to its absolute gradient sum for each neuron and then taking the mean of these ratio values. Here, \(m\) and \(n\) correspond to the number of iterations in the epoch and number of neurons(or weights) in a layer respectively for an epoch.

\[G^{\prime}_{l}=\Big{\{}\,0,\,when\,\,\sum_{j}^{m}|g_{lig}|=0\frac{1}{n}\sum_{i }^{n\,\,|\sum_{j}^{m}g_{ij}|},\,\,otherwise \tag{7}\]

The above formula also determines how the weights in a layer are modified with equal importance given to all the neurons in a layer. When all the weight updates of the neurons occur in the same direction across all iterations, its value is 1. With the modified formula, when some of the neurons are close to 1, it have higher chances of being amplified.

\[0\leqslant G^{\prime}_{l}\leqslant 1 \tag{8}\]
### Normalized layer gradient directionality ratio measure, \(\hat{G^{\prime}}\)

After computing the _layer gradient directionality ratio (\(G^{\prime}_{l}\))_ for each layer in an epoch, in order to identify the most significant layers close to 1, _layer gradient directionality ratio (\(G^{\prime}_{l}\))_ of all the layers are converted to a normal distribution using :

\[\hat{G^{\prime}}=\frac{G^{\prime}-\overline{\text{G}^{\prime}}}{\sigma_{G^{ \prime}}} \tag{9}\]

As previously mentioned, these normalized values signify how far they lie from the mean value. As \(G^{\prime}_{l}\) ranges between 0 and 1, large positive normalized values (signifying farther from the mean on the right side), can be considered close to the 1 (see equation 8), where as large negative normalized values can considered close to 0 (see equation 8).

### Determining amplification layers using \(G\),\(G^{\prime}\) measures

We consider the following cases to perform amplification based on thresholds. Here the formula are shown for measure \(G\) and the same cases can be applied for \(G^{\prime}\) (by replacing \(G\) with \(G^{\prime}\)).

Case-1: Amplify only one side (\(G_{l}\) close to 1)When (\(G_{l}\)) values are close to 1, most of the weights in the layer are modified in the same direction. This suggests that the neurons are all moving down(or up) the slope to approach optima, learning rate can be increased. We amplify the gradients of the layer when its normalized value exceeds a threshold value,

\[if(\hat{G}>threshold)\ :\ amplify\ layer\]

Case-2: Amplify both sides (\(G_{l}\) close to 0 or 1)As mentioned earlier, the \(layer\_gradient\_directionality\_ratio\) (\(G_{l}\)) values close to 0 either mean they are close to optima or a plateau surface. If the weights are close to optima, adding small noise to the gradients will cause the weights to converge eventually. Otherwise, it would make the weights to cross the plateau surface and thereby improving the training process. With this assumption, we propose to amplify the gradients of a layer when the \(layer\_gradient\_directionality\_ratio\) (\(G_{l}\)) values are close to either end (i.e., 0 or 1), we amplify whenever the absolute normalized value crosses threshold value.

\[if(|\hat{G}|>threshold)\ :\ amplify\ layer\]

Here is the overview of the function to determine amplification layers
## 4 Experiments

Experiments are performed on CIFAR-10, CIFAR-100 datasets with the similar setup to the experiments performed as in paper [16]. We primarily perform thorough experiments for VGG-19, Resnet-18 and Resnet-34 models. These models are trained for 150 epochs, where the learning rate of the first 100 epochs is 0.1 and the next 50 epochs is 0.01. We perform experiments using the training strategy \(params_{1}=[(50,0.1,0,1),(100,0.1,is\_amp,2),(130,\)\(0.01,is\_amp,2),(150,0.01,0,1)]\), as shown in Fig. 1, where \(is\_amp\) represents a non-zero value when amplification is performed or 0 otherwise. The values in each element in the \(params\) list represent the end epoch, learning rate, is_amplification_performed(non-zero) and gradient amplification factor respectively. For instance, \((50,0.1,0,1)\) means that the model is trained with learning rate 0.1 until we reach 50 epochs, during which no layers are selected for gradient amplification and the amplification factor is 1. In our training strategy, where \(params_{1}=[(50,0.1,0,1),(100,0.1,is\_amp,2),(130,0.01,\)\(is\_amp,2),(150,0.01,0,1)]\), no amplification is performed for the first 50 epochs and gradients in the 51\({}^{st}\) epoch are analyzed to determine the layers to perform amplification until 100\({}^{th}\) epoch. At epoch 101, learning rate is
reduced to 0.01 and gradients are analyzed again to determine next set of amplification layers, where the selected layers are amplified for the next 29 epochs and the last 20 epochs are trained without amplification. Experiments are performed using varying thresholds from 0.7 to 2.5 with the step size of 0.1. Based on the analysis of these results, we also run experiments on even deeper resnet-50 and resnet-101 models.

For deeper models, another training strategy \(params_{2}=[(10,0.1,0,1),\)\((100,0.1,is\_amp,2),(145,0.01,is\_amp,2),(150,0.01,0,1)]\) is employed, in which no amplification is performed for the first 10 epochs and the gradients in the \(11^{th}\) epoch are analyzed to identify the layers to perform amplification until \(100^{th}\) epoch. At epoch 101, learning rate is reduced to 0.01 and the gradients are analyzed again to determine next set of amplification layers, where the selected layers are amplified for the next 44 epochs and the last 5 epochs are trained without amplification. The number of epochs trained without amplification can be varied at runtime. In our experiments, we just demostrate

Figure 1: Experimental setup and training strategy for all the models, showing the number of epochs and the corresponding learning rates(\(\eta\)).

Figure 2: Performance of the amplified models (red) where layers are selected at different rates compared to mean accuracies of the original models (blue) with no gradient amplification. In each figure, we show the performance (%) of the models when amplification layers are selected once per learning rate (top), selected every 2 epochs (middle) and selected every 5 epochs (bottom). Horizontal axis refers to the thresholds applied on the normalized gradient rate (\(\hat{G}_{l}\)) using case-2 strategy, while vertical axis shows the testing accuracies (%) of the models.
with either 5 or 20 as our last epochs without amplification. Experiments are performed varying thresholds from 1 to 3 with the step size of 0.25.

We also perform analysis on how frequent the amplification layers need to be varied while training the model. In our training strategy, amplification is applied from 51-100 (\(\eta=0.1\)) and 101-130 (\(\eta=0.01\)) epochs. At first, amplification layers are determined on the onset of amplification epochs for each different learning rate and then analysis is done when the amplification layers are changed every 2 epochs from 51-130 and then every 5 epochs.

## 5 Results

In our experiments, firstly we analyze simpler models namely, resnet-18, resnet-34 and VGG-19 models using CIFAR-10 dataset and then extend to deeper resnet architectures and also for CIFAR-100 dataset.

While training these models, a first few epochs are trained normally without any amplification. Then the gradients of the models are analyzed for an epoch by computing normalized gradient rates for all layers. As mentioned previously, for each layer it determines the rate of fluctuations of weight updates, with 1 corresponding to less fluctuations and 0 for more fluctuations. Since thresholds are measured on normalized gradient rates of layers, values beyond thresholds signify the percentage of layers being amplified and indirectly controls the ratio of amplified layers. Lower the threshold value means larger the ratio of amplified layers and vice versa. In our experiments, thresholds are varied from 0.7 - 2.5 in steps of 0.1 for simpler models and from 1.0 - 3.0 in steps of 0.25 for deeper models.

### How frequently should amplification layers be modified/reseleted?

Analysis is also done on how frequent should these amplification layers be selected by running experiments when amplification layers are changed once per each learning rate, every 2 epochs and 5 epochs. Fig. 2 shows the performance of vgg-19, resnet-18 and resnet-34 models when these models are amplified using case-2 selection strategy and has similar performance for case-1 selection strategy. It can be observed that the performance improvement does not vary much for a model and one can always fine-tune to determine the best possible layer selection frequency. However, for our further analysis on CIFAR-10 dataset on deeper resnet-50, resnet-101 models, amplification layers are changed once per learning rate for simplicity.
### Analysis on CIFAR-10 dataset
always perform better than original models. Models with case-1 strategy seems to be robust compared to case-2 for lower thresholds. While using case-2 strategy, for lower thresholds, amplified models perform lower than the original models but the performance of the amplified models increases with increasing thresholds. This suggests that deeper models perform better with higher threshold values. Models with case-1 as amplification strategy perform better for thresholds more than 1.25, and for case-2, models with thresholds 1.5 perform better.

### Analysis on CIFAR-100 dataset

To emphasize the generality of amplification, experiments are also performed on CIFAR-100 dataset. In these experiments, amplification layers are selected once per each learning rate in the training epochs while using previously mentioned training strategies. Experiments are performed with both gradient change measures \(G\) and \(G^{\prime}\) using case-1 and case-2 layer selection strategies.

Analysis on simpler models:Fig. 7, 8 show the performance of VGG-19, resnet-18 and resnet-34 models for a range of thresholds 0.7-2.5 with a step-size of 0.1 when \(G\) and \(G^{\prime}\) amplification is applied respectively with \(params_{1}=[(50,0.1,0,1),(100,0.1,is\_amp,2),(130,0.01,is\_amp,2),\)\((150,0.01,0,1)]\) as the training strategy. For VGG-19 models, when case-1 amplification method is used, for lower thresholds with both \(G\) and \(G^{\prime}\),

Figure 4: Testing accuracies % (Y-axis) of the amplified models (red) using \(G^{\prime}\) compared to mean accuracies of the original models (blue) with no gradient amplification for a range of thresholds (X-axis) applied on the normalized gradient rate (\(\hat{G^{\prime}_{l}}\)) on CIFAR-10 dataset.
Figure 5: Testing accuracies % (Y-axis) of resnet-50 and resnet-101 models with \(G_{l}\) layer amplification (red) applied from epochs 51-145 compared to mean accuracies of the original models (blue) with no gradient amplification for a range of threshold values (X-axis).

Figure 6: (CIFAR-10 dataset) Testing accuracies % (Y-axis) of resnet-50 and resnet-101 models with \(G^{\prime}_{l}\) layer amplification (red), applied from epochs 51-145, compared to mean accuracies of the original models (blue) with no gradient amplification for a range of threshold values (X-axis).
models perform better at lower threshold values but have similar performance to original models in the case of higher thresholds. When case-2 is used,performance of the models is sensitive to threshold values. Models have lower performance than original models for small thresholds and have similar performance for large thresholds. For intermediate threshold values, it either has better or similar performance to original models. For resnet-18, when case-1 is used, for all the models have better performance than the original models for all the thresholds. Performance of the models increase with the thresholds around 1.5 and then the performance improvement remains the same. While for case-2, models have reduced performance for lower thresholds upto 0.9 in \(G\) and 1.1 in \(G^{\prime}\) which then increases until 1.5 and then the improvement remains the same. Resnet-34 models also have similar performance behavior as resnet-18 models maintaining the improved performance with increasing thresholds for case-2. While for case-1, for both \(G\) and \(G^{\prime}\), accuracies of the models are lower than the original models (until threshold reaches 1.2) and are better than original models after 1.2. The improvement of the accuracies are maintained with the increasing thresholds.

Analysis on deeper models:For deeper networks, resnet-50 and resnet-101, amplification is performed on reduced thresholds ranging from 1.0 - 3.0 in steps of 0.25. Fig. 9 and 10 show the testing accuracies of the resnet-50 and resnet-101 models for a range of thresholds with \(params_{2}=[(10,0.1,0,1)\), \((100,0.1,is\_amp,2),(145,0.01,is\_amp,2),(150,0.01,0,1)]\) as the training strat

Figure 7: Performance of the models on CIFAR-100 dataset with amplified models (red) using \(G\) applied from epochs 51-130 compared to mean accuracies of the original models (blue) with no gradient amplification. Horizontal axis refers to the thresholds applied on the normalized gradient rate (\(\hat{G_{l}}\)) and vertical axis corresponds to testing accuracies (%) of the models.
egy. In resnet-50 models, for both \(G\) and \(G^{\prime}\) while using case-1 strategy, amplified models always perform better than original models and the improvement of the accuracies almost remain the same across threshold values. While for case-2 strategy, models have lower performance for threshold value 1.00 and the testing accuracies are better than the original models from threshold 1.25. In resnet-101 models, for both \(G\) and \(G^{\prime}\), amplified models perform better from thresholds 1.25 and 1.50 respectively while using case-1 and case-2 strategy. Though the improvement in the performance appears the same, testing accuracies improve slowly with increasing thresholds.

### Comparison of running times

Table 1 and 2 show the mean running times(in minutes) across 10 runs of original models and amplified models for different ratio measures and cases. Training is performed on the GSU high performance cluster with NVIDIA V100 GPUs with only our models running on the GPUs with no other user jobs. Performing amplification while training increases the training times by only 1-3 minutes for all the models in most of the cases. Therefore, training models performing amplification improves the accuracy of the models maintaining training times closer (less than 2% increment) to original models.

### Best models

Here, we compare the best results of amplified models in each case with their corresponding original models without amplification. Testing accuracies of the best amplified models are shown in the table 3 and 4 for CIFAR-10

Figure 8: Testing accuracies % (Y-axis) of the amplified models (red) using \(G^{\prime}\) compared to mean accuracies of the original models (blue) with no gradient amplification for a range of thresholds (X-axis) applied on the normalized gradient rate (\(\hat{G^{\prime}_{l}}\)) on CIFAR-100 dataset.
Figure 10: (CIFAR-100 dataset) Testing accuracies (Y-axis) of resnet-50 and resnet-101 models with \(G^{\prime}_{l}\) layer amplification (red) applied from epochs 51-145 compared to mean accuracies of the original models (blue) with no gradient amplification for a range of threshold values (X-axis).

Figure 9: (CIFAR-100 dataset) Testing accuracies (Y-axis) of resnet-50 and resnet-101 models with \(G_{l}\) layer amplification (red) applied from epochs 51-145 compared to mean accuracies of the original models (blue) with no gradient amplification for a range of threshold values (X-axis).
and CIFAR-100 datasets. Training and testing accuracies for each epoch of these best models with amplification along with the original models. Fig. 11 shows the best performing models while using measure \(G\) for CIFAR-10 dataset. Similar improvements are observed for while using \(G^{\prime}\) on CIFAR-10 and also while using these measures on CIFAR-100 dataset. Since the mean accuracy of the original models are compared, their training accuracies(in gray), testing accuracies (in blue) including their mean accuracies are plotted along with amplified training(in green) and testing(in red) accuracies. These results are shown in Fig. 11.

\begin{table}
\begin{tabular}{c c c|c|c|c} \hline \hline \multirow{2}{*}{Model} & \multirow{2}{*}{_Original (min)_} & \multicolumn{2}{c}{_Ours_ using \(\tilde{G}\)(min)_} & \multicolumn{2}{c}{_Ours_ using \(\tilde{G}\)(min)_} \\ \cline{3-6}  & & Case-1 & Case-2 & Case-1 & Case-2 \\ \hline _VGG\_19_ & 31.35 min \(\pm\) 0.45 & 31.82 min \(\pm\) 0.52 (**1.5\%**) & 31.94 min \(\pm\) 0.45 (**1.89\%**) & 31.87 min \(\pm\) 0.45 (**1.66\%**) & 31.82 min \(\pm\) 0.35 (**1.5\%**) \\ _Resnet\_18_ & 42.15 min \(\pm\) 0.23 & 42.79 min \(\pm\) 0.45 (**1.53\%**) & 42.73 min \(\pm\) 0.46 (**1.38\%**) & 42.96 min \(\pm\) 0.57 (**1.92\%**) & 42.76 min \(\pm\) 0.44 (**1.45\%**) \\ _Resnet\_34_ & 66.35 min \(\pm\) 0.92 & 67.73 min \(\pm\) 0.95 (**2.09\%**) & 67.64 min \(\pm\) 0.9 (**1.94\%**) & 67.8 min \(\pm\) 0.82 (**2.18\%**) & 67.68 min \(\pm\) 0.91 (**2.01\%**) \\ _Resnet\_50_ & 139.64 min \(\pm\) 1.97 & 139.71 min \(\pm\) 2.01 (**0.05\%**) & 140.07 min \(\pm\) 1.50 (**0.31\%**) & 140.63 min \(\pm\) 1.29 (**0.71\%**) & 141.06 min \(\pm\) 1.05 (**1.01\%**) \\ _Resnet\_101_ & 224.22 min \(\pm\) 3.45 & 225.48 min \(\pm\) 2.89 (**0.56\%**) & 226.37 min \(\pm\) 2.07 (**0.96\%**) & 227.26 min \(\pm\) 2.12 (**1.35\%**) & 227.78 min \(\pm\) 2.02 (**1.58\%**) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Mean running times(in minutes) of models with \(G,G^{\prime}\) layer-based gradient amplification on CIFAR-10 dataset across 10 iterations.

\begin{table}
\begin{tabular}{c c|c|c|c|c} \hline \hline \multirow{2}{*}{Model} & \multirow{2}{*}{_Original (min)_} & \multicolumn{2}{c}{_Ours_ using \(\tilde{G}\)(min)_} & \multicolumn{2}{c}{_Ours_ using \(\tilde{G}\)(min)_} \\ \cline{3-6}  & & Case-1 & Case-2 & Case-1 & Case-2 \\ \hline _VGG\_19_ & 31.62 min \(\pm\) 0.48 & 32.55 min \(\pm\) 0.43 (**2.92\%**) & 31.92 min \(\pm\) 0.49 (**0.92\%**) & 32.16 min \(\pm\) 0.69 (**1.7\%**) & 31.83 min \(\pm\) 0.57 (**0.64\%**) \\ _Resnet\_18_ & 42.08 min \(\pm\) 0.47 & 42.83 min \(\pm\) 0.64 (**1.78\%**) & 42.24 min \(\pm\) 0.69 (**0.39\%**) & 43.44 min \(\pm\) 2.65 (**3.23\%**) & 42.19 min \(\pm\) 0.57 (**0.26\%**) \\ _Resnet\_34_ & 66.64 min \(\pm\) 0.84 & 67 min \(\pm\) 0.89 (**0.54\%**) & 66.99 min \(\pm\) 0.96 (**0.53\%**) & 69.84 min \(\pm\) 6.11 (**4.8\%**) & 66.88 min \(\pm\) 0.9 (**0.36\%**) \\ _Resnet\_50_ & 139.32 min \(\pm\) 1.18 & 140.64 min \(\pm\) 0.51 (**0.95\%**) & 140.21 min \(\pm\) 1.7 (**0.64\%**) & 140.68 min \(\pm\) 0.51 (**0.97\%**) & 140.79 min \(\pm\) 0.68 (**1.06\%**) \\ _Resnet\_101_ & 223.88 min \(\pm\) 2.09 & 226.35 min \(\pm\) 3.05 (**1.10\%**) & 226.28 min \(\pm\) 1.87 (**1.07\%**) & 225.99 min \(\pm\) 3.23 (**0.54\%**) & 225.12 min \(\pm\) 2.18 (**1.00\%**) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Mean running times(in minutes) of models with \(G,G^{\prime}\) layer-based gradient amplification on CIFAR-100 dataset across 10 iterations.

Figure 11: Testing accuracies % (Y-axis) of the best models on CIFAR-10 dataset with amplification performed using \(G\) algorithm (1) compared to original models without amplification. Mean training (gray) and mean testing (blue) accuracies (as well as original testing accuracies in light blue) are plotted, along with amplified training (green) and testing (red) accuracies.
plots signify the importance of having the final epochs of the model to be trained without amplification and also demonstrate that the models do not overfit while training with amplification.

We also perform random amplification for deeper resnet models using some of the hyperparameters which have the better performance for resnet-18, resnet-34 models. The best accuracies of these models are also compared in the table below for both CIFAR-10 and CIFAR-100 datasets. Our results with amplification based on \(G\) and \(G^{\prime}\) have similar performance and sometimes improved for VGG-19, resnet-18 and resnet-34 models on CIFAR-10 dataset. Resnet-50 and resnet-101 more than 2% improvement than original as well as randomly amplified models. In the case of CIFAR-100 dataset, all the models based on \(G\) and \(G^{\prime}\) have significant performance improvement compared to original and random amplification.

## 6 Conclusion

We propose two measures to compute effective gradient direction of a layer during the training process. These measures are used to determine the amplification layers based on two amplification thresholding strategies. Detailed experiments are performed to analyze each of the measures and their

\begin{table}
\begin{tabular}{c c c c c c|c|c} \hline \hline \multirow{2}{*}{Model} & \multirow{2}{*}{\(Original\)} & \multicolumn{2}{c}{_Random layer_} & \multicolumn{2}{c}{_Ours_ using \(\hat{G}\)} & \multicolumn{2}{c}{_Ours_ using \(\hat{G}^{\prime}\)} \\ \cline{3-8}  & & \multicolumn{1}{c|}{_amplification_[16]} & Case-1 & Case-2 & Case-1 & Case-2 \\ \hline _VGG_19 & 65.27\% & 66.52\% (**+1.25\%**) & 69.38\% (**+4.11\%**) & 68.5\% (**+3.23\%**) & 69.83\% (**+4.56\%**) & 69.25\% (**3.98+\%**) \\ _Resnet\_18_ & 71.94\% & 72.7\% (**+0.760\%**) & 75.33\% (**+3.39\%**) & 75.41\% (**+3.47\%**) & 76.14\% (**+4.2\%**) & 75.35\% (**+3.41\%**) \\ _Resnet\_34_ & 72.18\% & 73.02\% (**+0.84\%**) & 74.86\% (**+2.68\%**) & 75.59\% (**+3.41\%**) & 75.95\% (**+3.77\%**) & 75.9\% (**+3.72\%**) \\ _Resnet\_50_ & 72.32\% & 73.05\% (**+0.73\%**) & 77.21\% (**+4.89\%**) & 77.43\% (**+5.11\%**) & 76.89\% (**+4.57\%**) & 76.97\% (**+4.65\%**) \\ _Resnet\_101_ & 73.00\% & 73.72\% (**+0.72\%**) & 77.63\% (**+4.63\%**) & 77.51\% (**+4.51\%**) & 77.53\% (**+4.53\%**) & 77.63\% (**+4.63\%**) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Performance comparison of random, \(G\), \(G^{\prime}\) layer-based gradient amplification models on CIFAR-100 dataset.

\begin{table}
\begin{tabular}{c c c c|c|c|c|c} \hline \hline \multirow{2}{*}{Model} & \multirow{2}{*}{\(Original\)} & \multicolumn{2}{c}{_Random layer_} & \multicolumn{2}{c}{_Ours_ using \(\hat{G}\)} & \multicolumn{2}{c}{_Ours_ using \(\hat{G}^{\prime}\)} \\ \cline{3-8}  & & \multicolumn{1}{c|}{_amplification_[16]} & Case-1 & Case-2 & Case-1 & Case-2 \\ \hline _VGG\_19_ & 91.08\% & 93.35 \% (**+2.27\%**) & 93.30\% (**+2.22\%**) & 92.92\% (**+1.84\%**) & 93.29\% (**+2.21\%**) & 93.34\% (**2.26+\%**) \\ _Resnet\_18_ & 92.39\% & 94.57\% (**+2.18\%**) & 93.90\% (**+1.51\%**) & 93.76\% (**+1.37\%**) & 94.49\% (**+2.1\%**) & 94.1\% (**+1.71\%**) \\ _Resnet\_34_ & 92.71\% & 94.39\%(**+1.68\%**) & 94.05\% (**+1.34\%**) & 93.89\% (**+1.18\%**) & 94.56\% (**+1.85\%**) & 94.14\% (**+1.43\%**) \\ _Resnet\_50_ & 91.80\% & 92.68\% (**+0.88\%**) & 94.24\% (**+2.44\%**) & 94.43\% (**+2.63\%**) & 94.34\% (**+2.54\%**) & 94.02\% (**+2.22\%**) \\ _Resnet\_101_ & 91.95\% & 93.04\% (**+1.09\%**) & 94.57\% (**+2.62\%**) & 94.54\% (**+2.59\%**) & 94.35\% (**+2.4\%**) & 94.7\% (**+2.75\%**) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Performance comparison of random, \(G\), \(G^{\prime}\) layer-based gradient amplification models on CIFAR-10 dataset.
amplification strategies for a range of thresholds. Experiments performed on CIFAR-10 and CIFAR-100 datasets using different models show that intelligent amplification gets better accuracy compared to original models without amplification, even when trained with higher learning rates. In this work, gradient amplification is experimented on VGG and resnet models. As this method can be easily integrated into various deep learning architectures[42], future work could extend this method to deep belief networks[43], recurrent neural networks[44], attention networks[45], fuzzy/hybrid neural networks [46; 47; 48; 49; 50; 51] and graph neural networks[52].

**CRediT authorship contribution statement**

**Sunitha Basodi:** Conceptualization, Methodology, Software, Validation, Investigation, Writing - original draft, Visualization. **Krishna Pusuluri:** Conceptualization, Methodology, Software, Investigation, Validation, Writing - review & editing. **Xueli Xiao:** Methodology, Resources, Software, Writing - review & editing. **Yi Pan:** Supervision, Funding acquisition, Project administration, Conceptualization, Methodology, Investigation, Validation, Writing - review & editing.

**Declaration of competing interest**

All the authors declare that they have no competing interests.

**Data availability**

Openly available datasets are used in this work.

**Acknowledgments**

Research Computing Technology and Innovation Core (ARCTIC) resources, which is supported by the National Science Foundation Major Research Instrumentation (MRI) grant number CNS-1920024. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Tesla K40 GPU also used for this research.