## 1 Introduction  
The _hyperconnected intelligent world_ (HIW), which has been described as the technology trend of 2023, was founded on the Internet of Things (IoT), which is the network of connected devices that gather the data we need to build intelligent systems ([[https://www.forbes.com/sites/bermardmarr/2022/09/26/the-5-biggest-technology-trends-in-2023-everyone-must-get-ready-for-now/](https://www.forbes.com/sites/bermardmarr/2022/09/26/the-5-biggest-technology-trends-in-2023-everyone-must-get-ready-for-now/)]([https://www.forbes.com/sites/bermardmarr/2022/09/26/the-5-biggest-technology-trends-in-2023-everyone-must-get-ready-for-now/](https://www.forbes.com/sites/bermardmarr/2022/09/26/the-5-biggest-technology-trends-in-2023-everyone-must-get-ready-for-now/)), accessed on 28 December 2023). The HIW is shaped by IoT data and empowered by artificial intelligence (AI); it is essential for creating data-driven actionable insights. In this work, we closely examine two of such systems: energy theft detection enabled by the Internet of Energy Things (IoT) and remote stress detection enabled by the Internet of Medical Things (IoMT) [1, 2]. IoET-based systems are key in the transition toward clean energy; however, the penetration rate of smart meters (basic IoET devices) is very slow (e.g., only 57% in 2023 in the UK ([[https://assets.publishing.service.gov.uk/media/646f7f4f4d6e70012a9b3f6/Q1_2023_Smart_Meters_Statistics_Report.pdf](https://assets.publishing.service.gov.uk/media/646f7f4f4d6e70012a9b3f6/Q1_2023_Smart_Meters_Statistics_Report.pdf)]([https://assets.publishing.service.gov.uk/media/646f7f4f4d6e70012a9b3f6/Q1_2023_Smart_Meters_Statistics_Report.pdf](https://assets.publishing.service.gov.uk/media/646f7f4f4d6e70012a9b3f6/Q1_2023_Smart_Meters_Statistics_Report.pdf)), accessed on 28 December 2023)). For this reason, IoET systems have been selected as pivotal use cases within HIW, highlighting their significance in achieving a sustainable future. IoMT-based systems, which have a direct impact on health and human lives, are selected as another critical HIW use case, representing systems with no tolerance for security threats, data leakages, or tampering with life-critical IoMT devices. The potential of marrying IoT and AI in these two applications has been well established but the uptake of related technology is still slow. While connected IoT devices are the key components of such systems, they also create security risks and introduce vulnerabilities that are targeted by attackers to gain access to these systems. Regarding IoT and IoMT, compromising the data transmitted (e.g., man-in-the-middle--MITM) or stored (e.g., malware attack) in the systems represents a serious threat. For instance, the malicious acquisition of energy consumption data would reveal patterns indicating when residents are not at home, potentially inviting targeted robbery attempts [3]. Similarly, unlawful access to biometric data generated by an IoMT device could be used to identify the individual, track their location, and correlate their stress level to targeted marketing, stalking, or worse. It follows that improving the IoT systems' capabilities to thwart these security attacks is a challenge and a priority in any HIIW-related research. In this work, we address IoT security from two perspectives. The _first_ work examines malware attack detection mechanisms and proposes an artificial immune system (AIS) that is suitable for the limited computational power of IoT devices in combatting these types of attacks. Malware attacks often lead to the leakage of stored data in the IoT device, gateway, or server. Servers benefit from high computational power and, therefore, can be programmed with complex malware detection mechanisms that mitigate this risk. IoT devices and gateways on the other hand are often mounted on limited energy, low cost, low memory, and low computational power equipment and, thus, are incapable of hosting elaborate malware detection algorithms.