A Robust Federated Learning Approach for Combating Attacks Against IoT Systems Under non-IID Challenges