The deployment of artificial intelligence (AI) in Intelligent Transportation Systems (ITS), especially in the field of Intelligent Transportation Cyber-Physical Systems (ITCPS) has a strong potential to achieve higher efficiency, reliability, and increased safety in both transportation and traffic. This work focuses on the real-world implementation of ITCPS, in which structure and elements in combination with advanced image processing methods increase safety and fluidity of road traffic at crossroads and railway crossings. In this work, we present a novel system called Artificial Intelligence-based Detection System for Road Security (ADEROS), which combines elements of CPS systems, object detection, and classification, computer vision (CV) which analyzes vehicle trajectory tracking, vehicle and pedestrian presence, light signaling systems, railway barriers at railway crossings, and railway warnings. The presented system is based on a camera module that is suitably positioned to capture the entire scene. The module uses graphics processing units (GPU) for accelerated image processing techniques and the YOLOv4 deep neural network model to detect traffic participants and then dangerous situations in various crossroads and railway crossings. Our improved unique detector can distinguish between individual types of road users and the status of several safety devices at crossroads and railway crossings (for example, the state of traffic lights (TL) or rail barriers). Furthermore, we present experimental implementation details of the ADEROS system, which includes a central server web interface for live traffic situation monitoring, various communication channels for the camera module, and a central server based on.NET core, Cassandra DB, and different security protocols. All data from risky situations are evaluated and transferred to the central server securely without human intervention. The central server aggregates and archives all risky situational data from connected cameras. Finally, we present our experimental results from a real-world pilot project that consists of a camera module prototype deployed in a real crossroad and an operational central web server.