I am doing human activity recognition project. I have total of 12 classes. The class distribution look like this:

enter image description here

$\color{red}{If \ you \ watch \ carefully, you \ can \ see \ that \ I \ have \ no \ data \ points \ for \ class \ 11 \ and \ class \ 8.}$ Also, the dataset is highly imbalanced. So, I took minimum data points (in this case 2028) for all of the classes. Now my balanced data look like this:

enter image description here

After doing this it looks like a balance data. $\color{red}{But \ still, \ I \ think \ it \ not, \ because \ I \ have \ zero \ datapoints \ for \ class \ 11 \ and \ class \ 8}$. In my opinion the classes are still imbalance.

I am using CNN model to solve this activity project. My model summary is following:

enter image description here

The main problem is, my model starts overfitting heavily when I train it.

enter image description here

Is it due to my imbalance data( class 8 and 11 has zero data points) or something else?


$\textbf{features:}$ X, Y, Z of mobile accelerometer

$\textbf{frame size:}$ 80

$\textbf{optimizer:}$ Adam, $\textbf{Learning rate:}$ 0.001

$\textbf{Loss:}$ Sparse categorical cross-entropy


Your zero-classes just do not exist for the model. There is no information about them in training and test sets. I think the reason for overfitting is that your have very small size of the training set comparing to the number of parameters in your model. If it is easier for a model to remember all training entries - it will just do that. You need to prune your model to force it to make some generalizations about the data.

  • $\begingroup$ Those images are from the original dataset. Before feeding it to the model , I reduce the class by 1 ( class 1 becomes class 0 and so on). Yes, I know in case of overfitting I have to reduce the model complexity. But I don't think it is the case in this problem, $\endgroup$ Jun 18 '20 at 8:40
  • $\begingroup$ You have about 20k entries in the training data and 500k parameters to learn on them. The proportion is reversed, you'd better have 5-10m entries in the training data to properly train such a model. $\endgroup$ Jun 18 '20 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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