I am bit confused in the Mixup data augmentation technique, let me explain the problem briefly:

What is Mixup

enter image description here

For further detail you may refer to original paper .

We double or quadruple the data using classic augmentation techniques (e.g., Jittering, Scaling, Magnitude Warping). For instance, if the original data set contained 4000 samples, there will be 8000 samples in the data set after the augmentation.

On the other hand, according to my understanding, in Mixup data augmentation, we do not add the data but rather mix the samples and their labels and use these new mixed samples for training to produce a more regularized model. Am I correct? If yes, then why is the Mixup method referred to as data augmentation? Since we only mix samples and not artificially increase the data set size?

  • 3
    $\begingroup$ Since mixup combines existing images and labels in the dataset to create a new sample that was not in the dataset previously (i.e. creating new observations) this a type of data augmentation. See also the definition of data augmentation from wikipedia: "Data augmentation in data analysis are techniques used to increase the amount of data by adding slightly modified copies of already existing data or newly created synthetic data from existing data." $\endgroup$
    – Oxbowerce
    Commented Jan 15, 2022 at 12:09
  • $\begingroup$ @Oxbowerce Thank you for your comment. Actually, I went through the code (found at keras.io/examples/vision/mixup), and after applying the mixup, the number of sample sizes is the same as the original. However, on the other side, data size grows as I increase the samples using traditional augmentation (e.g., scaling, etc.). This confuse me a lot. $\endgroup$
    – Ahmad
    Commented Jan 17, 2022 at 4:04
  • 1
    $\begingroup$ This because the new samples created using mixup (or any data augmentation technique for that matter) come from using the map method on the dataset, meaning that the samples are only created at the moment they are retrieved from the dataset (i.e. on-the-fly) and are not added to the original dataset. Therefore the number of samples in the dataset does not change. $\endgroup$
    – Oxbowerce
    Commented Jan 17, 2022 at 8:50
  • $\begingroup$ @Oxbowerce thank you so much. It means samples are artificially generated during the training and model are trained on both original data as well as artificially generated data, am I right? If that is the case, then how many samples are artificially generated? Moreover, can I have some resource material on map, to get the complete idea? $\endgroup$
    – Ahmad
    Commented Jan 18, 2022 at 7:21
  • 1
    $\begingroup$ It is indeed correct that the samples are generated during training, depending on the probability of augmentation the model might only be trained on augmented samples. The number of samples generated depends on how long you train the model for, simply said each time a sample is retrieved from the dataset first the original sample is retrieved, after which it goes through the augmentation pipeline and is then fed to the model. You can find more information on the map method in the tensorflow documentation $\endgroup$
    – Oxbowerce
    Commented Jan 18, 2022 at 8:46

1 Answer 1


I came to the conclusion that Mix-up is data augmentation after a lengthy discussion with Oxbowerce in above comments:

"Since mixup combines existing images and labels in the dataset to create a new sample that was not in the dataset previously (i.e., creating new observations), this is a type of data augmentation." Thank you, Oxbowerce; I genuinely appreciate your efforts


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.