Leveraging Artificial Intelligence Methodologies to Improve WSN Security