4 Methods to Boost the Accuracy of a Neural Network Model

Amrianto Saragih
5 min readJan 27, 2019

--

Graph of accuracy and epoch

Enhancing a model accuracy of machine learning isn’t easy to do. but if you’ve an experience about it, you realize that what am i trying to say is true. I’m sure, a lot of you would agree with me if you’ve found yourself stuck in a similar situation. you try all strategies and all algorithm that you’ve learnt and you found that this strategies were several way to gain more high accuracy of machine learning model. i will show you several way to enhance model accuracy in neural network. why i choose neural network is because neural network is one of machine learning method which is easy way to explain you about enhancing a model accuracy of machine learning. let’s in to the explanation.

Add more dataset

Dataset

The first thing that we can do to enhance a model accuracy is to add more data to train your model. Having more data is always a good idea.
I realize that to get more data isn’t easy to do. For instance, we do not get a choice to increase the size of training data because we haven’t more data and we can’t find more data from outside.

Feature Selection

Pen Shelf

Feature Selection is a process of finding out the best subset of attributes which better explains the relationship of independent variables with target variable [1].
1. Domain Knowledge
Based on domain experience, we select feature(s) which may have higher impact on target variable [1]. in my experience, i’ve never choose an attributes that have a lot of different value. for example, an ID is an unique value and a string that have a lot of differentiation between one and another like a human’s name.
2. Visualization
it helps to visualize the relationship between variables, which makes your variable selection process easier. make a visualization of all attribute in graph. and visualize the attribute one by one on the graph.

Normalization

Normalization is a term to ensure that the data haven’t high different value between one and another. Normalization refers to rescaling real valued numeric attributes into the range 0 and 1. It is useful to scale the input attributes for a model that relies on the magnitude of values, such as salary in indonesia is a milions and value of gender (if you’ve label it) is 0 of 1. it was an obvious example that the value of salary is too big and the other side the value of gender label is too small.

Why would we normalize in the first place?

1. Normalization makes training less sensitive to the scale of features, so we can better solve for coefficients.
2. The use of a normalization method will improve analysis from multiple models.
3. Normalizing will ensure that a convergence problem does not have a massive variance, making optimization feasible.

more about normalization, you can read this

Tuning Algorithm

Guitar Tune

Tuning Algorithm is about tune the parameters of machine learning algorithm to get the optimum value of each parameter. it will improve the accuracy of model to predict data. To tune these parameters, you must have a good understanding of these meaning and their individual impact on model.
for instance, in neural network you can tune parameter like hidden layer, activation function, epoch, optimizer, batch_size, learning rate, Verbose, dropout, Cross Validation [2, 3].

This is the real example of enhancing model accuracy using one of parameters tuning algorithm.

using hidden layer
i used loss=binary_crossentropy, optimizer=adam, batch_size=5, epoch = 50, verbose=1. in below, we can see the number of units, activation function and the accuracy.

Units of hidden layer
Model Accuracy

the number of hidden units are 60, 30, 20 and the accuracy is about 71%. now, we will compare to the other number of units.

Units of hidden layer
Model Accuracy

the number of hidden units are 60, 30, 20 and the accuracy is about 73%. we can see the differentiation of accuracy between the first (71% ) and the second (73%) is 2% and the second is the higher from the first one. it’s not about the higher the value of units will enhance the accuracy of model. but we can try for many time to get highest accuracy of our model. and so for another parameters. you can try it out in your home to know better about tuning algorithm.

--

--