# Object-Based Approach for Adaptive Source Coding of Surveillance Video
## 3 Proposed Adaptive Coding Method Using Object Dynamics
### Modeling the Statistical Relationship  
Assume \(p\) random variables, \(X_{i}\), \(1\leq i\leq p\), corresponding to the characteristics of object dynamics. Video quality is set as response variable \(Y\) being a function of \(X_{i}\) as follows:  
\[Y=f\big{(}X_{1},\ldots,X_{p}\big{)}+e, \tag{1}\]  
where \(e\) is a residual term representing modeling error and the random effect of the system. The response surface \(E(\gamma|x_{1},\ \ldots\,\ x_{p})=f(X_{1},\ \ldots\,\ X_{p})\), where \((x_{1},\ \ldots\,\ x_{p})\in\{(X_{1},\ \ldots\,\ X_{p})\}\), can be explained by parameters \(\beta_{0}\), \(\beta_{1}\), \(\ldots\,\beta_{p}\). If regress equation is \(\beta\) (i.e., the regression coefficient) system of linear equations, we can describe a multi-variable linear regression model as follows:  
\[Y=\beta_{0}+\beta_{1}X_{1}+\beta_{2}X_{2}+\cdots+\beta_{p}X_{p}+e, \tag{2}\]  
where \(\beta_{i}=\partial E(\gamma|x_{1},\ \ldots\,\ x_{p})/\partial x_{i}\), \(i=1,\ 2,\ \ldots\,\ k\). In this linear regression model, \(Y\) is the PSNR that numerically represents video quality and \(X_{i}\) denotes an object's size and speed, that is, \(p=2\). Typically, the least squares method is used to obtain the optimal solution of a linear regression model. Here, consider the residual value between observed values \(y_{i}\) and the estimated value \(\hat{y_{i}}\) expressed as \(e_{i}=y_{i}-\hat{y_{i}}\). The sum of square errors (SSE) can be written as follows:  
\[\sum_{i=1}^{n}{(e_{i})}^{2}=\sum_{i=1}^{n}{(y_{i}-\beta_{0}-\beta_{1}x_{1,i}- \beta_{2}x_{2,i})}^{2} \tag{3}\]  
The least squares method is used to solve \(\beta_{0}\), \(\beta_{1}\), \(\beta_{2}\) to obtain the minimum SSE value. Note that this method is a simple, efficient, and common estimator. However, least squares estimates can perform poorly when the error distribution is not normal. Please note that outliers are sample values; however, they may be correct but should always be checked for transcription errors. In addition, they can seriously interfere with standard statistical methods. For a more precise estimation, we require a robust regression method to enhance our linear regression that is less sensitive to outliers. The most common and robust regression method is M-estimation [29; 30]. M-estimation uses an objective function and a weight function to enhance regression. In addition, M-estimation uses an M-estimator to minimize the objective function. For example, the least squares method's objective function is \(e_{i}^{2}\) and weight function is 1. We use [PERSON]'s bisquare (biweight) [31] algorithm to adjust our estimation. The bisquare defines new objective and weights function, which are expressed as follows:  
\[O(e)=\left\{ \begin{array}{ll}\frac{k^{2}}{6}\left\{1-\left[1-\left(\frac{e}{ k}\right)^{2}\right]^{3}\right\}&for\left|e\right|\leq k\\ \frac{k^{2}}{6}&for\left|e\right|>k\end{array} \right., \tag{4}\]  
\[W(e)=\left\{ \begin{array}{ll}\left[1-\left(\frac{e}{k}\right)^{2}\right]^{2 }&for\left|e\right|\leq k\\ 0&for\left|e\right|>k\end{array} \right., \tag{5}\]  
where \(e\) is the previously mentioned residual and \(k\) is a positive constant. We use multiple coefficients of determination typically denote \(R^{2}\) to evaluate the goodness of fit of our linear regression. Here, we define the sum of squares total as \(SST=\sum_{i=0}^{n}{(y_{i}-\overline{y})}^{2}\), where \(\overline{y}\) is the sample mean of \(y_{i}\), and the sum of squares due to regression is expressed as \(SSR=\sum_{i=0}^{n}{(\hat{y_{i}}-\overline{y})}^{2}\). The total difference of variable \(y_{i}\) can be expressed as \(y_{i}-\overline{y}=\hat{y_{i}}-\overline{y}+y_{i}-\hat{y_{i}}\), i.e., SST = SSR + SSE.