# Shot Classification of Field Sports Videos Using AlexNet Convolutional Neural Network
## 3 Results and Discussion
### Performance Evaluation Using Different Classifiers
#### 3.5.2 Classification Using Support Vector Machine (SVM)  
For classification using SVM, we first extract features from the dataset and then performed training on the extracted features. We used Local Binary Patterns (LBPs) and Local Tetra patterns (LTrPs) for feature extraction [28], which is discussed in detail in this section. We computed the LBPs by comparing the grayscale values of the center pixel of the given image with its neighbor as follows:  
\[LBP_{Q,R}=\sum_{i=1}^{Q}\left(2^{(i-1)}\times\mathfrak{f}_{1}(S_{i}-S_{c})\right) \tag{14}\]  
\[\mathfrak{f}_{1}(x)=\left\{ \begin{array}{ll}1,&x\geq 0\\ 0,&else\end{array} \right. \tag{15}\]  
where \(LBP_{Q,R}\) represents the LBP value at the center pixel \(S_{c}\). \(S_{c}\) and \(S_{i}\) represents the grayscale value of the center pixel and the neighboring pixels, respectively. Q is the number of neighbors and R is the radius of the neighborhood. For LTrPs computation, we calculated the first order derivative in the vertical and horizontal directions and encoded the relationships between the referenced pixel and its neighbors. For image \(K\), the first order derivative along zero and 90 degrees are calculated as:  
\[K_{0}^{1}\left(S_{c}\right)=\ K(S_{g})-K(S_{C}) \tag{16}\]  
\[K_{90}^{1}\left(S_{c}\right)=\ K(S_{h})-K(S_{C}) \tag{17}\]  
where \(S_{c}\) denotes the center pixel in \(K\), \(S_{g}\) and \(S_{h}\) represents the horizontal and vertical neighbors of S. The direction of center pixel \(S_{c}\) is calculated as:  
\[K_{DIR}^{1}(S_{c})= \begin{cases}1,&K_{0}^{1}(S_{c})\geq 0\ and\ K_{90}^{1}(S_{c}) \geq 0\\ 2,&K_{0}^{1}(S_{c})<0\ and\ K_{90}^{1}(S_{c})\geq 0\\ 3,&K_{0}^{1}(S_{c})<0\ and\ K_{90}^{1}(S_{c})<0\\ 4,&K_{0}^{1}(S_{c})\geq 0\ and\ K_{90}^{1}(S_{c})<0\end{cases}  \tag{18}\]  
From Equation (18), four different values, i.e., 1, 2, 3, and 4 is calculated and these values are named as the direction values. The second order derivative is calculated which converts the values into three binary patterns called local ternary patterns and direction is defined using the Equation (18). Local tetra patterns are generated by calculating Euclidean distance with respect to reference direction pixels. After creating the local patterns (LBPs, LTrPs), we represented each image through the histogram as:  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Videos** & **Accuracy** & **Error Rate** & **Precision** & **Recall** & **F1-Score** \\ \hline Video 1 & 91.89 & 8.11 & 92.79 & 97.45 & 92.97 \\ Video 2 & 91.27 & 8.73 & 91.78 & 95.67 & 93.34 \\ Video 3 & 91.67 & 8.33 & 90.23 & 96.89 & 91.78 \\ Video 4 & 92.01 & 7.99 & 92.01 & 98.42 & 91.37 \\ Video 5 & 91.02 & 8.98 & 91.02 & 97.1\[H=\frac{1}{M\times N}\sum_{k=1}^{M}\sum_{l=1}^{N}\ f(LP(k,l),w) \tag{19}\]  
\[f(x,y)=\left\{ \begin{array}{ll}1,&\mbox{ \ \ \ if }x=y\\ 0,&\mbox{ \ \ Otherwise}\end{array} \right\} \tag{20}\]  
where _LP_ represents the local patterns (LBPs, LTrPs) and \(M\times N\) is the size of the image. We applied a multi-class SVM classifier using different kernels for performance evaluation. We computed the SVM classifier through minimizing the following expression:  
\[\frac{1}{2}w^{T}w+C\sum_{i=1}^{N}\varepsilon_{i} \tag{21}\]  
Subject to the constraints:  
\[y_{i}\Big{(}w^{T}\varnothing(x_{i})+b\Big{)}\geq 1-\varepsilon_{i}\ \mbox{and}\ \varepsilon_{i}\geq 0,\ i=1,\ \ldots,\ N\]  
where C is the capacity constant, w is the vector of coefficients, b is a constant, and \(\varepsilon_{i}\) depicts parameters for handling non-separable data. i is the index that labels the N training cases. \(x_{i}\) depicts the independent variable. \(\varnothing\) is the kernel that is used to transform data from input to the feature space. The hyper-parameter for SVM classifier is the margin (C = 1) between two different classes. The largest the margin, the better will be the classifier results. Margin is the maximal width of the hyper-plane that has no interior data points. It has been observed that the larger the C, the more the error is penalized.