## 6 Conclusions  
The proposed framework leverages a novel integration of vision transformers with the spatiotemporal relationship attention technique to address the challenges of video anomaly detection in surveillance systems. In addition, this work applied a novel training strategy by combining different benchmark datasets to prove its robustness in dealing with large and distinct data. By utilizing the advantages of ViTs for capturing global context and the dynamic processing of STR attention for analyzing motions and interactions within frames, the unsupervised method produces a high-performance model suitable for large-scale and heterogeneous environments. This improvement illustrates the appropriateness of our technique for real-world scenarios, where diverse environmental conditions and data qualities often challenge existing systems. Our experiments show that our model not only performs superiorly to state-of-the-art anomaly detection techniques, but it also effectively adapts to the intricate variability of surveillance video data. Future research will examine how to scale this approach and improve the feature extraction capabilities using different ViTs, if we access more powerful resources, to handle even more complex and varied datasets, such as the whole 1.15 million frame CHAD dataset. Moreover, the memory mechanism could be incorporated to increase the capacity of the model for feature acquisition. Additionally, further adjustments and optimizations could improve the framework's application, potentially setting a new standard for automated surveillance systems and making them more reliable, efficient, and capable of handling the intricacies of real-world anomalies.  
Conceptualization, L.A.E., M.S. and M.H.H.; methodology, L.A.E., M.S. and M.H.H.; software, M.H.H.; validation, L.A.E. and M.S.; formal analysis, L.A.E., M.S. and M.H.H.; investigation, L.A.E., M.S. and M.H.H.; writing--original draft preparation, M.H.H.; writing--review and editing, L.A.E., M.S. and M.H.H.; visualization, M.H.H.; supervision, L.A.E., M.S. and M.H.H. All authors have read and agreed to the published version of the manuscript.  
This work was supported by the Information Technology Industry Development Agency (ITIDA)-Information Technology Academia Collaboration (ITAC) program under grant number CFP24.  
The data presented in this work are openly available in \"UCSD Anomaly Detection Dataset\" at: [[[http://www.svcl.ucsd.edu/projects/anomaly/dataset.htm](http://www.svcl.ucsd.edu/projects/anomaly/dataset.htm)]([http://www.svcl.ucsd.edu/projects/anomaly/dataset.htm](http://www.svcl.ucsd.edu/projects/anomaly/dataset.htm))], accessed on 18 May 2023, reference number [29], \"Avenue Dataset for Abnormal Event Detection\" at [[[https://www.cse.cuhk.edu.hk/leoja/projects/detectohnormal/dataset.html](https://www.cse.cuhk.edu.hk/leoja/projects/detectohnormal/dataset.html)]([https://www.cse.cuhk.edu.hk/leoja/projects/detectohnormal/dataset.html](https://www.cse.cuhk.edu.hk/leoja/projects/detectohnormal/dataset.html))], accessed on 18 May 2023, reference number [30], \"ShanghaiTech Campus dataset (Anomaly Detection)\" at [[[https://svip-lab.github.io/dataset/campus_dataset.html](https://svip-lab.github.io/dataset/campus_dataset.html)]([https://svip-lab.github.io/dataset/campus_dataset.html](https://svip-lab.github.io/dataset/campus_dataset.html))], accessed on 29 November 2023, reference number [31], and \"CHAD: Charlotte Anomaly Dataset\" at [[[https://github.com/TeCSAR-UNCC/CHAD](https://github.com/TeCSAR-UNCC/CHAD)]([https://github.com/TeCSAR-UNCC/CHAD](https://github.com/TeCSAR-UNCC/CHAD))], accessed on 2 June 2024, reference number [32].  
The authors gratefully acknowledge the Information Technology Industry Development Agency (ITIDA)-Information Technology Academia Collaboration (ITAC) program technical and financial support.  
The authors declare no conflicts of interest.