Cyber-physical systems are infrastructures that use digital information such
as network communications and sensor readings to control entities in the
physical world. Many cyber-physical systems in airports, hospitals and nuclear
power plants are regarded as critical infrastructures since a disruption of its
normal functionality can result in negative consequences for the society. In
the last few years, some security solutions for cyber-physical systems based on
artificial intelligence have been proposed. Nevertheless, knowledge domain is
required to properly setup and train artificial intelligence algorithms. Our
work proposes a novel anomaly detection framework based on error space
reconstruction, where genetic algorithms are used to perform hyperparameter
optimization of machine learning methods. The proposed method achieved an
F1-score of 87.89% in the SWaT dataset.