Optimised Learning Models For Defending Against Cyber Attacks In Cyber-Physical Systems