Surveillance cameras have been widely deployed in public and private areas in recent years to enhance security and ensure public safety, necessitating the monitoring of unforeseen incidents and behaviors. An intelligent automated system is essential for detecting anomalies in video scenes to save the time and cost associated with manual detection by laborers monitoring displays. This study introduces a deep learning method to identify abnormal events and behaviors in surveillance footage of crowded areas, utilizing a scene-based domain generalization strategy. By utilizing the keyframe selection approach, keyframes containing relevant information are extracted from video frames. The chosen keyframes are utilized to create a spatio-temporal entropy template that reflects the motion area. The acquired template is then fed into the pre-trained AlexNet network to extract high-level features. The study utilizes the Relieff feature selection approach to choose suitable features, which are then served as input to Support Vector Machine (SVM) classifier. The model is assessed using six available datasets and two datasets built in this research, containing videos of normal and abnormal events and behaviors. The study found that the proposed method, utilizing domain generalization, surpassed state-of-arts methods in terms of detection accuracy, achieving a range from 87.5% to 100%. It also demonstrated the model's effectiveness in detecting anomalies from various domains with an accuracy rate of 97.13%.