## 3 Edge Artificial Intelligence
### AI for Security  
AI-assisted EC enables the collection, storage, and processing of large volumes of IoT data. The convergence of EC and AI has given rise to a new discipline--AI at the edge, or edge intelligence. Edge AI provides faster, real-time decision-making capabilities in decentralized, resource-constrained environments [104]. AI models, as illustrated in Figure 7, hosted at the network edge, leverage machine learning (ML) algorithms that dynamically learn from data patterns to identify known threat signatures and predict previously unseen threats. These algorithms establish a baseline of normal behavior for edge devices and network segments through continuous monitoring and analysis of IoT data. Early-stage anomaly detection enables quick investigation and timely responses, minimizing the impact of potential security breaches. AI algorithms can also apply advanced encryption techniques to data at the edge, ensuring compliance with data protection regulations such as the General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA). AI models--such as neural networks and anomaly detection algorithms--can detect fraudulent manipulation of sensor data or unauthorized access to control systems in industrial environments [107]. Edge AI encompasses four key domains: (i) edge caching, (ii) edge training, (iii) edge inference, and (iv) edge offloading. Edge caching collects, generates, and stores data from edge devices and their surroundings to support edge applications. Edge training utilizes local data and computational resources at the edge to mitigate the need for high-bandwidth data transfers to the cloud. Edge inference focuses on running AI algorithms directly at the edge to enable real-time decision-making. Edge offloading distributes computationally intensive tasks by relocating them from edge devices to the cloud for further processing [108]. AI models at the edge enable edge devices to make quicker decisions without relying on cloud services [109]. Thus, AI potentially offers IoT security, including the following:  
* Threat detection:It detects unidentified threats in real time by analyzing network traffic, system logs, and other data sources. * Access control: Reinforces access control mechanisms at edge devices by analyzing user behavior and identifying anomalies using AI. * User authentication: User behavior and irregularities, like login attempts, can be monitored and detected using AI-based biometric data analysis, such as fingerprint recognition, facial recognition, and voice identification. * Network security: AI effectively examines and responds to real-time cyberattacks by analyzing network traffic data from numerous sources, such as firewalls and intrusion detection systems. * Vulnerability detection: AI identifies vulnerabilities in IoT devices and applications by examining code and configuration files. It can simulate attacks to uncover weaknesses and provide security updates or patch recommendations. Figure 7: ML in IoT security. * Predictive maintenance: AI can predict potential device failures and security vulnerabilities by analyzing historical data and patterns. However, security measures should be integrated throughout the entire AI lifecycle, from training to inference, as AI systems are vulnerable to various threats. These include evasion attacks, which manipulate models to produce incorrect outputs; data poisoning, where adversaries corrupt the training data; and privacy threats, such as membership inference and model inversion attacks, which can compromise sensitive information [110]. As shown in Figure 8, machine learning (ML) is a subfield of Artificial Intelligence (AI) capable of identifying meaningful patterns or relationships from data. In contrast, DL is a subfield of ML that uses artificial neural networks (ANNs) to structure algorithms in a way that mimics human learning.