Text this: Cross-Layer Analysis of Machine Learning Models for Secure and Energy-Efficient IoT Networks