A swarm intelligence-based approach to anomaly detection of dynamic systems