A Distributed and Hybrid AI-Based Security Framework for 5G Real-time Applications