The quality of human existence is improving day by day, and the internet of things (IoT) has arisen as a new world of technology in the last two decades. It has aided the world through its applications in many sectors. However, while delivering several benefits, the extreme expansion of IoT devices makes them a potential target of attacks, which jeopardise the organisation if left unchecked. Cyber security analysts have recently been using the DL-based model to detect and investigate malware in order to keep the organization secure from cyber-attacks. This work describes how AI-based techniques are utilized to identify cyber threats in the IoT environments better while considering these devices' heterogeneous and resource-constrained nature so that no extra burden is imposed on them. This work comprehensively evaluated the current solutions, challenges, and future directions in IoT security.