# Video Quality Modelling--Comparison of the Classical and Machine Learning Techniques
## 3 Materials and Methods
### Using a Machine Learning Model  
Initially, the data were split into a training set and a test set. The training set contained 180 videos with resolutions of 360p, 480p, 720p, and 1080p for the codecs H.264, H.265, and VP9. The test set contained 36 videos with resolutions of 720p and 1080p for the codecs H.264 and H.265. Videos with resolutions of 720p and 1080p for the codecs H.264 and H.265 were divided between the training and test series in such a way that the distribution of ratings was similar. The scenario that includes the phase of training the model and then using it for quality prediction is shown in Figure 3.  
First, a subset of the training data was used to train the model, and then the model was used to predict the subjective video quality rating. In both cases, i.e., during model training and prediction, separate subsets of objective quality metrics values were used as input to the model. Various learning algorithms were tested to build a machine learning model that would best predict video quality. As input to the model, a subset of objective quality assessment values obtained from individual quality metrics (10 metrics, 32 parameters in total) and a subset of user assessment (MOS) values obtained during subjective studies were used. Tests were performed for the following models:  
1. Linear regression assumes a linear relationship between the input variables (features) and the output variable (result). The linear regression model is represented by: \[y=\beta_{0}+\beta_{1}x_{1}+\beta_{2}x_{2}+\ldots+\beta_{p}x_{p}+\epsilon,\] (5) where: \(y\)--dependent variable, \(\beta_{0}\)--intercept, \(\beta_{1},\beta_{2},\ldots\)\(\beta_{p}\)--the regression coefficients, \(x_{1},x_{2},\ldots\)\(x_{p}\)--the independent variables (features), \(\epsilon\)--random error. 2. Ridge regression is a variant of linear regression that adds L2 regularisation to prevent overfitting by penalising large regression coefficients. The ridge regression model minimises the loss function. \[L(\beta)=\sum_{i=1}^{n}\left(y_{i}-\beta_{0}-\sum_{j=1}^{p}\beta_{j}x_{ij} \right)^{2}+\sum_{j=1}^{p}\beta_{j}^{2},\] (6)  
Figure 3: Using an ML model to predict video quality. where: \(\lambda\)--regularisation parameter. 3. Lasso regression adds L1 regularisation, which can lead to some coefficients becoming zero, thus performing feature selection. The Lasso model minimises the loss function. \[L(\beta)=\sum_{i=1}^{n}\left(y_{i}-\beta_{0}-\sum_{j=1}^{p}\beta_{j}x_{ij}\right) ^{2}+\lambda\sum_{j=1}^{p}\bigl{|}\beta_{j}\bigr{|}.\] (7)
4. Elastic Net combines L1 (Lasso) and L2 (Ridge) regularisation to gain the benefits of both methods. The Elastic Net model minimises the loss function. \[L(\beta)=\sum_{i=1}^{n}\left(y_{i}-\beta_{0}-\sum_{j=1}^{p}\beta_{j}x_{ij} \right)^{2}+\lambda_{1}\sum_{j=1}^{p}\bigl{|}\beta_{j}\bigr{|}+\lambda_{2} \sum_{j=1}^{p}\beta_{j}^{2},\] (8) where: \(\lambda_{1}\) and \(\lambda_{2}\)--regularisation parameters. 5. Support Vector Regression (SVR) is a variant of Support Vector Machines (SVMs) that is used for regression problems. SVR tries to find a regression line that is maximally distant from the nearest data points. The loss function in SVR is: \[L(\beta)=\frac{1}{2}\bigl{\|}\beta\bigr{\|}^{2}+C\sum_{i=1}^{n}max\Bigl{(}0, \Bigl{|}y_{i}-\Bigl{(}\beta_{0}+\sum_{j=1}^{p}\beta_{j}x_{ij}\Bigr{)}\Bigr{|} -\epsilon\Bigr{)}\,\] (9) where: \(C\)--regularisation parameter, \(\epsilon\)--width of the insensitive band. 6. Decision trees split the data into subsets by making decisions based on feature values. Each internal node represents a test on an attribute, each branch represents the outcome of the test, and each leaf represents a class or target value. The data are split into nodes by maximising a certain criterion, such as entropy for classification or mean squared error for regression. 7. Random forests are an ensemble learning method that trains multiple decision trees on random subsets of data and features.