Machine Learning-Based Security Solutions for Critical Cyber-Physical Systems