# Edge AI for Real-Time Anomaly Detection in Smart Homes
## 5 Results and Discussion  
### Anomaly Detection Performance  
To evaluate the effectiveness of the proposed Edge AI-based anomaly detection system, we conducted anomaly detection experiments using synthetic IoT sensor data. The dataset consists of three key parameters commonly monitored in smart home environments: temperature, motion, and energy usage. Anomalies were artificially injected to simulate unusual events, such as sudden temperature spikes, unexpected motion activity, and abnormal energy consumption surges. To assess the effectiveness of different anomaly detection techniques, we compared the performance of the Isolation Forest and LSTM Autoencoder models. Table 5 presents the total number of anomalies detected by each method and the percentage of data marked as anomalous. \begin{table}
\begin{tabular}{l l l} \hline \hline
**Model** & **Total Anomalies Detected** & **Percentage of Data Anomalous** \\ \hline Isolation Forest & 30 & 3.00\% \\ LSTM Autoencoder & 30 & 3.00\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of anomalies detected by Isolation Forest and LSTM Autoencoder models. The table highlights the total number of anomalies identified and the proportion of the dataset flagged as anomalous by each method. Although both models detected the same number of anomalies, their classification reliability varied, particularly in terms of false positives and false negatives. False positives occur when normal sensor readings are incorrectly classified as anomalies, leading to unnecessary alerts, while false negatives represent actual anomalies missed by the model, potentially causing security or operational risks. Tables 6 and 7 show that confusion matrices were generated for each model to better understand these differences. The LSTM Autoencoder's ability to detect time-dependent anomalies with fewer false negatives suggests it is better suited for applications that require continuous monitoring, such as smart home security and predictive maintenance. On the other hand, Isolation Forest, while faster and more energy-efficient, may produce more false alarms that could lead to unnecessary interventions. These results reveal some critical distinctions between the two models. The LSTM Autoencoder demonstrated better sensitivity to actual anomalies, successfully identifying twenty-seven true positives while only missing three, whereas Isolation Forest identified twenty-four true positives but failed to detect six anomalies. The lower false negative rate of LSTM Autoencoder (three vs. six for Isolation Forest) indicates that it is less likely to overlook actual anomalies, making it more effective in safety-critical applications such as fire hazard detection or energy theft monitoring. At the same time, it produced fewer false positives than Isolation Forest, which misclassified normal readings as anomalies more frequently. While the LSTM Autoencoder demonstrated superior anomaly detection accuracy, it required a higher computational load, leading to increased power consumption. In contrast, Isolation Forest, while less precise in detecting sequential anomalies, consumed 30% less energy, making it more suitable for deployment on battery-operated edge devices. A hybrid approach could potentially leverage the strengths of both models, where the Isolation Forest serves as an initial anomaly detector, and the LSTM Autoencoder refines the classification to minimize false positives while maintaining real-time responsiveness. Using Isolation Forest as a fast, low-power anomaly flagging mechanism and LSTM Autoencoder for deeper sequential validation, the hybrid model minimizes unnecessary alerts while maintaining high anomaly detection reliability. Figure 2 highlights the trade-offs between the two approaches. While the LSTM Autoencoder achieved higher accuracy (0.92) and recall (0.90), it required more power (4.2 W) compared to Isolation Forest (2.8 W), meaning it consumes nearly 50% more energy compared to Isolation Forest.