Overfitting

  • Loss function curve

  • In machine learning, overfitting means the method is more complex than the problem, such that it can perform well on the training dataset but does not perform well on the testing dataset

    • The model is too complicated that it may fit the noise in the data

Solutions

Data

  • Reason: The samples of data is too small, which do not reflect the true distribution

  • Solutions: Data Augmentation
    Noise misleads the model to learn a wrong distribution, but no noise can be troublesome if the dataset is small. Therefore, we can add some noise to the label, if the noise is little and uniformly distributed

Model

  • Reason: The model is too large that consists of too many useless parameters

  • Solutions: Transfer Learning
    We can use some pre-trained models, which are trained on different tasks with lots of data and related to our target task. In this case, we can use the pre-trained model by freezing some layers and only fine-tuning several final layers of the model using the training data of the target task.

    1. The data size that the model has seen is enlarged
    2. The model has already learned useful features
    3. We may only fine-tune a few final layers

Connectivity

  • Reason: The model is too strong, leads to co-adaptation
    The neural network should not rely on one node or feature too much

  • Solutions: Dropout
    Notice that the neural network should not rely on one node or one feature so much. During the training process, we can randomly/stochastically discard some nodes and edges (such that we only train a part of the model in one iteration), by adding noise to the model to increase smoothness. In the testing phase, all nodes are placed back.

    • Keeping rate: usually between 0.5 to 0.8

Parameter value range

  • Reason: The range of the parameters’ values is too large (too high degree of freedom), which is too flexible

  • Solutions: Weight decay / Regularizer
    Penalize over the large weight values $\frac{\lambda}{2}||\mathbf{w}||^2$

    Notice: the term in gradient descent $\alpha \lambda w_{ij}^{(k)}$ decrease the absolute value of $\mathbf{w}$, decays the weight every time training the model

Training time

  • Reason: The training time is too long (over learning the data), tend to overfitting

Out-of-distribution

  • In general, we assume the testing distribution is the same as the training distribution, the model can perform well on the testing distribution if there is no overfitting problem
  • Out-of-distribution generation, the testing distribution is different from the training distribution. In this case, even if there is no overfitting, the model can perform badly on the testing distribution

  • Covariate shift
    The distributions of training data and testing data, (the samples X), are different

  • Label shift
    The distributions of the labels, (y), are different

  • Concept shift
    The concepts are different, which leads to different of distributions

  • Conditional distribution shift
    The distributions have different conditions