Application of deep learning in the early detection of emergency situations and security monitoring in public spaces