# Three-Stage Deep Learning Framework for Video Surveillance
## 4 Experiment and Results
### Ablation Study  
The key strength of this architecture lies in the potent combination of the BiLSTM, multi-head attention layer, and Transformer encoder. The BiLSTM and multi-head attention layer excels in effectively handling short-term dependencies and intricately capturing the local features of sequences. This enables a deeper understanding of each part of the sequence, which is particularly useful in capturing dynamic elements, such as changes over time. On the other hand, the Transformer encoder is adept in processing long-term dependencies in sequence data and is exceptional at capturing global patterns across the entire sequence. This is beneficial in understanding the relationships between distant elements in a sequence and analyzing data in a broader context. When these two layers are used in conjunction, the model can effectively capture both short-term and long-term dependencies within sequence data, effectively integrating them. This approach allows for a more accurate understanding of complex patterns and relationships within the input sequence and prevents an over-reliance on specific patterns, thus avoiding overfitting and enabling the model to make decisions based on finer details. Additionally, this architecture enhances the model's generalization capability, allowing for more accurate predictions across various types of data and scenarios, especially in processing time series data like videos. To validate our approach, we separately configured and trained the BiLSTM and multi-head attention layer (the second stage) and the modified Transformer encoder layer (the third stage). The results of these ablation training sessions are presented in Tables 4 and 5. Table 4 demonstrates the measurement of the AUC using the UBI-Fights dataset, where we first evaluated all three stages together, followed by configurations of only stages 1 and 3, and then stages 1 and 2. Table 5 assesses the accuracy using the Crowd dataset in a similar manner. As evidenced in Tables 4 and 5, the performance was most superior when all stages were integrated, with the combination of stages 1 and 2 following closely. This indicates that the temporal insight and multi-dimensional feature capture capabilities of the BiLSTM and multi-head attention, when combined with the pattern analysis prowess of the modified Transformer encoder, enabled a deeper understanding of the sequence data and more accurate predictions. The results of these ablation experiments underscore the exceptional performance of the combined layers, suggesting their utility in various sequence data processing tasks, including video analysis and time series data handling. Additionally, to validate the effectiveness of the proposed Transformer encoder block, we conducted further ablation studies. Experiments were performed on the UBI-Fights dataset by varying the number of heads in the CvlBiLT architecture's Transformer block. The results are presented in Table 6. The best performance was observed with eight heads, and a trend of diminishing performance was noted when the number of heads was either too low or too high. Furthermore, to demonstrate the efficacy of relative position embeddings, we conducted comparative experiments using the best-performing CvlBiLT architecture, applying absolute position embeddings for comparison. The outcomes of these experiments are detailed in Table 7. The results indicated that the application of relative position embeddings outperformed the use of absolute position embeddings. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Network** & **Whole Architecture** & **Without Second Stage** & **Without Third Stage** \\ \hline VBiLT & 96.33 & 95.97 & 96.06 \\ MobileBiLT & 97.96 & 96.76 & 97.18 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparative analysis of training results for networks configured with different stages using the UBI-Fights dataset.