1
$\begingroup$

The objective of the NN is to classify instances (tuples of $50$ real values) as either 'signal' or 'background' (labeled as '0' or '1'). After scaling the tuples to contain values from $0$ to $1$, I build the model as:

model = Sequential([
    Dense(units=16, input_shape=(50,), activation='relu'),
    Dense(units=32, activation='relu'),
    Dense(units=2, activation='softmax')
])

I chose Adam with $0.0001$ learning rate and sparse categorical crossentropy as loss.

Then I fit the model with batch size $100$ and $30$ epochs (training and test set contain $36000$ instances each).

Then, the graphs of accuracy and loss are respectively: enter image description here

enter image description here

Is my model underfitting and if so, what causes it? Should I use a different optimizer, activation function, loss function or number of epochs? Any suggestions for improving it are welcome.

$\endgroup$

1 Answer 1

1
$\begingroup$

It doesn't look like the model is underfitting from these graphs. The model is learning something, which can be seen from the decreasing validation loss. It is also not overfitting too badly, because the validation loss isn't deviating from the training loss too much, it's still decreasing.

Underfitting would be the model not picking up on a pattern that is in the dataset. You wouldn't be able to tell it from these graphs, except if, for some reason, you expect the model accuracy to get much higher, for example, because some more complicated model is getting better accuracy.

From general principles, I would say a model with 2 hidden layers is pretty complex, so underfitting wouldn't be a major concern. That said, a CNN with many layers is effective for MNIST, which has only 28x28=784 input values, so not that far off, but with many more parameters.

$\endgroup$
4
  • $\begingroup$ So, in your opinion, all the parameters I chose (optimizer, number of epochs, loss function, act. function) are suitable for this problem? Also, if the above is true, does the relatively low accuracy (~90%) means that there is a problem with the data (high correlation between some features, outliers, some features with low seperability etc)? $\endgroup$
    – Paris
    Commented Jan 11, 2021 at 10:51
  • $\begingroup$ It's not really possible to tell if they are suitable. The system works at least "fine", 90% is much better than 50%, random guessing. Why do you say 90% is relatively low accuracy? Correlation between features is not a problem, outliers could be if they are really bad. I don't know anything about this problem, but if you could solve any binary decision to 90%, you should be a rich man, by predicting if a stock goes up or down or predicting sports matches. $\endgroup$
    – Gijs
    Commented Jan 11, 2021 at 10:56
  • $\begingroup$ You're right. I guess I'm influenced by other NNs (i.e. CNN for digit recognition) which can achieve something like 99.7% acc. $\endgroup$
    – Paris
    Commented Jan 11, 2021 at 11:00
  • 1
    $\begingroup$ Aha yes that is a high bar for a classification problem! $\endgroup$
    – Gijs
    Commented Jan 11, 2021 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.