## 3 Architectural System Design
### System Architecture
#### 3.8.1 ResRNN-Net and MultiScaleFusion-Net

Table 3: Cross- validation performance of ResRNN-Net and MultiScale Fusion Net. #### 4.1.2 Advanced Model Training and Evaluation

For increased model refinement, an advanced evaluation and training scheme was adopted involving addressing class imbalance, efficient pipelines, early termination, and maximized threshold learning. The measures ensured stable performance while avoiding significant overfitting. The data were shown to have extreme class imbalance, with complications more common than non-complications. To counter this, SMOTE was used only on the training set, creating synthetic samples for the minority class. Class weights were also calculated to provide greater significance to under-represented samples, encouraging balanced learning. An efficient data pipeline was produced based on TensorFlow's tf.data API. This pipeline enabled effective batch processing, shuffling, and prefetching, minimizing training bottlenecks. A batch size of 128 was used to trade off computational efficiency against memory usage. Both ResRNN-Net and MultiScaleFusionNet were trained with the Adam optimizer (learning rate 0.0005) and binary cross-entropy loss. Early stopping (patience of two epochs) avoided overfitting, and ReduceLROnPlateau reduced the learning rate by half upon performance plateau. In order to optimize the F1-score, predictions were tested over thresholds from 0.3 to 0.7. The optimal threshold that yielded the highest F1-score was chosen for ultimate testing. To compare the deep learning models, XGBoost and a voting ensemble (random forest + logistic regression) were trained under the same conditions. XGBoost utilized early stopping, whereas the ensemble utilized soft voting for stable predictions. Table 5 illustrates the performance metrics of all the models, wherein ResRNN-Net and MultiScaleFusion-Net stood out as the best. The outcome proved that both deep learning models--ResRNN-Net and MultiScaleFusion-Net--performed better than the conventional models, with higher F1-scores, recall, and ROC-AUC. MultiScaleFusion-Net showed slightly higher recall, while ResRNN-Net maintained better balance across all the measures. #### 4.1.3 Hyperparameter Tuning for ResRNN-Net and MultiScale Fusion Net

To maximize model performance and generalizability, hyperparameter tuning was performed for the ResRNN-Net and MultiScaleFusion-Net architectures. This was conducted to determine the optimal learning rate, batch size, and dropout rate configurations, which would maximize prediction accuracy and model efficiency. The following hyperparameters were tuned: \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Performance Metrics** & **Multimodal Model (Tabular)** & **Multimodal Model (Integrated All 3 Datasets)** \\ \hline
**Accuracy** & 0.80 \(\pm\) 0.0025 & 0.60 \(\pm\) 7.2192 \\
**Precision** & 0.75 \(\pm\) 0.0081 & 0.55 \(\pm\) 0.0517 \\
**Recall** & 0.91 \(\pm\) 0.0184 & 1.00 \(\pm\) 0.0000 \\
**F1-Score** & 0.82 \(\pm\) 0.0037 & 0.71 \(\pm\) 0.0407 \\
**ROC-AUC** & 0.80 \(\pm\) 0.0025 & 0.60 \(\pm\) 0.0738 \\ \hline \end{tabular}
\end{table} 
Table 4: Cross-validation performance of tabular and integrated multimodal models. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Model** & **Best Thesh-old** & **Accuracy** & **Precision** & **Recall** & **F1-Score** & **ROC-AUC** \\ \hline ResRNN-Net & 0.40 & 0.80 & 0.73 & 0.93 & 0.82 & 0.87 \\ MultiScaleFusion-Net & 0.45 & 0.79 & 0.72 & 0.95 & 0.81 & 0.86 \\ XGBoost & 0.45 & 0.71 & 0.64 & 0.94 & 0.76 & 0.81 \\ Voting Ensemble & 0.40 & 0.78 & 0.72 & 0.93 & 0.81 & 0.86 \\ \hline Mean \(\pm\) Standard Deviation & & 0.7771 \(\pm\) 0.0299 & \(\pm\) 0.0303 & \(\pm\) 0.9325 & \(\pm\) 0.8075 & \(\pm\) 0.8539 & \(\pm\) 0.8539 & \(\pm\) 0.0213 \\ \hline \end{tabular}
\end{table} 
Table 5: Summary of model performance metrics with mean \(\pm\) standard deviation. * **Learning Rate:** [0.0003, 0.0005]--Controls gradient update step size.