# Leveraging IoT Devices for Atrial Fibrillation Detection: A Comprehensive Study of AI Techniques
## 4 Conclusions and Discussion  
In conclusion, this study focuses on the classification of atrial fibrillation (AF) using photoplethysmography (PPG) data, a non-invasive and widely available technique for measuring blood volume variations through optical sensors. The integration of Internet of Things (IoT) devices is crucial for acquiring PPG signals, as they enable real-time data collection and seamless transmission to cloud-based platforms for analysis. The primary objective was to explore diverse approaches and assess their effectiveness in accurately classifying AF. \begin{table}
\begin{tabular}{c c} \hline
**Option** & **Accuracy Score** \\ \hline
**Option 4** & 0.9462 \\ \hline
**Option 5** & 0.9406 \\ \hline Option 4: Deep Learning on Signal Time Series using a Custom CNN. Option 5: Transfer learning on Spectrogram Images using DenseNet121. \\ \hline \end{tabular}
\end{table} 
Table 4: Performance Comparison of Deep Learning Approaches \begin{table}
\begin{tabular}{c c c c c} \hline
**Option** & **Best-Model** & **Accuracy Score** & **F1-Score** & **AUC** \\ \hline \multirow{2}{*}{**Option 1**} & SVM & 0.9438 & 0.9437 & 0.9872 \\ \cline{2-5}  & Stack Model & 0.9438 & 0.9437 & 0.9872 \\ \hline \multirow{2}{*}{**Option 2**} & MLP & 0.9621 & 0.9620 & 0.9908 \\ \cline{2-5}  & Stack Model & 0.9707 & 0.9706 & 0.9974 \\ \hline \multirow{2}{*}{**Option 3**} & SVM & 0.9707 & 0.9707 & 0.9872 \\ \cline{2-5}  & Stack Model & 0.9768 & 0.9768 & 0.9967 \\ \hline \end{tabular}
\end{table} 
Table 3: Performance Comparison of Machine Learning Approaches. To prepare the PPG data for analysis, a series of preprocessing steps were implemented, including windowing, missing value removal, band-pass filtering, baseline correction, normalization, and artifact removal. These techniques facilitated the extraction of relevant features from the PPG signals, resulting in feature vectors crucial for effective classification. Various methodologies were explored for feature extraction, such as signal-based statistical features, wavelet spectrogram features, and features derived from convolutional neural networks (CNN). Subsequently, multiple machine learning models--including Support Vector Machine (SVM), Random Forest (RF), and Multi-Layer Perceptron (MLP)--were evaluated individually, with stacking models used to combine their predictions for enhanced performance. The findings revealed that CNN-based wavelet spectrogram features, when paired with the SVM model, consistently achieved the highest accuracy scores among the different feature extraction methods. This highlights the capability of CNN-based wavelet spectrograms to capture significant patterns within PPG signals, leading to accurate classification of AF. Additionally, the use of stacking models demonstrated substantial performance improvements over individual models, reinforcing the effectiveness of ensemble techniques in boosting classification accuracy and robustness. While deep learning approaches were explored, fine-tuning did enhance accuracy to some degree; however, the overall results remained lower compared to the feature extraction methods. This suggests that the complexity and nature of the classification tasks may have influenced the performance of the deep learning techniques, indicating a need for further investigation in this area to optimize their effectiveness. Specifically, developing models better tailored to PPG signals, rather than relying on transfer learning, could potentially lead to better performance. In summary, this study underscores the efficacy of utilizing PPG data, combined with feature extraction methods and machine learning models, for accurate AF classification. PPG serves as a non-invasive and easily accessible means for detecting and monitoring AF, and the role of IoT devices is pivotal in this process, as they facilitate real-time acquisition and transmission of PPG signals. Preprocessing techniques, such as wavelet transforms, help extract informative features from PPG signals.