# ML-Based Pain Recognition Model Using Mixup Data Augmentation
## 1 Introduction
Conventional ML models rely on extracting relevant features manually with the help of a feature extractor, which is subsequently used to optimize an inference model. Such approaches have proven to be effective; however, their performance might still be limited because of the dependency on an expert to extract features who might need to have domain-specific knowledge. To overcome this limitation, recent researchers have been focussing on deep learning (DL) architectures because of their ability to automatically extract features from the raw input data by applying a succession of simple and nonlinear transformations on the input data. DL models are a popular choice for automatic pain recognition systems because DL architectures learn complex functions due to a hierarchical construct of several processing layers, as also mentioned in [10]. While machine learning and deep learning architectures serve a wide range of applications, their potential often remains underutilized due to challenges such as memorization, sensitivity to adversarial examples, and overfitting, which limit their effectiveness. Similarly, many models developed for automatic pain recognition face these same challenges, reducing their accuracy. Various regularization and data augmentation techniques have been introduced to address these issues, including the mixup approach [11], which has demonstrated performance improvements. However, mixup has not yet been applied to physiological signals. While previous works have demonstrated the effectiveness of mixup, they have only been limited to images, sound, and text data. Either ML or DL could be used for pain recognition. In this work, the conventional ML approach is used wherein relevant features are extracted manually with the help of a feature extractor. This high-level input data representation is subsequently used to optimize an inference model. Such approaches have proven to be effective. Pain recognition can be achieved using numerous approaches by utilizing physiological signals, some of them by extracting hand-crafted features and then using them to train the ML model, others using a DL architecture. While ML models have enabled significant breakthroughs, they also exhibit undesirable behaviors such as memorization and sensitivity to adversarial samples, reducing the performance and generalization capabilities of these models. One solution to overcome this unexpected behavior is data augmentation. The authors of [12] state data augmentation as the method of choice to train on similar but different examples to the training data. Data augmentation improves the generalization and performance of ML algorithms by applying transformations such as rotations, translations, and flips. However,the procedure is dataset-dependent and thus requires the use of expert knowledge. Data augmentation also assumes that the examples in the vicinity share the same class and does not model the vicinity relation across samples of different classes. These issues motivated the authors of [11] to introduce a simple and data-agnostic data augmentation technique called \"mixup\". Mixup has gained significant attention and has been shown to enhance the robustness and accuracy of ML and DL models. Mixup involves blending pairs of samples and their corresponding labels to create new synthetic training examples. Mixup takes two samples, \(x_{i}\) and \(x_{j}\), and their associated labels, \(y_{i}\) and \(y_{j}\), and creates new examples, \(\hat{x}\) and \(\hat{y}\), as weighted linear combinations. The equations can be represented as follows:  
\[\tilde{x} =\lambda x_{i}+(1-\lambda)x_{j} \tag{1}\] \[\hat{y} =\lambda y_{i}+(1-\lambda)y_{j} \tag{2}\]  
where (\(x_{i}\),\(y_{i}\)) and (\(x_{j}\), \(y_{j}\)) are two samples drawn at random from the extracted features, as mentioned in [11]. Here, \(\lambda\in[0,1]\) is a random value drawn from a beta distribution with a user-defined parameter \(\alpha\), typically set between 0.1 and 0.4.