## 3 Architectural System Design
### System Architecture
#### 3.8.1 ResRNN-Net and MultiScaleFusion-Net  
Data Preprocessing and Balancing: The NFHS-5 dataset was processed to handle inconsistencies. Missing values were imputed using mean (numerical) and mode (categorical). StandardScaler was applied for feature normalization. Class imbalance was addressed using a hybrid NearMiss under-sampling and SMOTE over-sampling technique. **Feature Selection:** The LASSO was applied to select 51 highly predictive features, reducing dimensionality and improving model efficiency. **Model Development:** Two deep learning architectures were constructed:  
* **ResRNN-Net**: A hybrid architecture combining Bi-LSTM (64 units) for sequential learning, CNN (64 filters, kernel size = 3) for spatial feature extraction, an attention mechanism for feature prioritization, and a dense layer (128 units) for final predictions. Figure 10: The implementation procedure for the deep learning framework—pipeline overview. * **MultiScaleFusion-Net**: This model has a Bidirectional GRU (64 units), and it captures multiscale dependencies using Conv1D layers with kernel sizes of 1, 3, and 5. Outputs are concatenated and processed through a dense layer (128 units) followed by a sigmoid classifier. The architectural choices of ResRNN-Net and MultiScaleFusion-Net are based on the nature and complexity of the NFHS-5 dataset. While the data are tabular, several variables exhibit logical progressions or temporal dependencies--such as antenatal visit sequences, immunization coverage, and time-related lifestyle changes. To exploit these implicit patterns, ResRNN-Net integrates Bi-LSTM for capturing sequential patterns, CNN for extracting local feature interactions, and attention mechanisms for prioritizing influential signals. On the other hand, MultiScaleFusion-Net employs GRU units for lightweight sequence modeling and leverages multiscale Conv1D filters to capture patterns at varying granularities across feature subsets. These architectures were selected to balance performance, interpretability, and computational efficiency for personalized maternal health prediction tasks. **Training and Evaluation:** The data were divided into training (80%) and validation subsets (20%). Deep learning models were trained utilizing the Adam optimizer with a learning rate of 0.0005 and a batch size of 64. Overfitting was avoided with early stopping (patience = 3 epochs) and also learning rate reduced dynamically on plateau in performance by using the ReduceLROnPlateau callback. For rigorous evaluation, 5-fold stratified cross-validation was utilized. Metrics used to evaluate models included accuracy, precision, recall, F1-score, and ROC-AUC, thereby ensuring balanced analysis across all aspects of performance. Algorithm 1 illustrates the steps of ResRNN-Net and MultiScaleFusion-Net framework. ``` Input: Scaled input features \(X_{\text{scaled}}\), binary labels \(y\), input shape \(s\), number of dense blocks \(L\), growth rate \(k\), selected block indices \(\{l_{1},l_{2},\ldots,l_{k}\}\) Output: Binary prediction \(\hat{y}\)
1: Perform stratified train/validation split \((X_{\text{train}},y_{\text{train}})\), \((X_{\text{val}},y_{\text{val}})\leftarrow\text{StratifiedShuffleSplit}(X_{ \text{scaled}},y)\)
2: Apply SMOTE on training data: \((X_{\text{res}},y_{\text{res}})\leftarrow\text{SMOTE}(X_{\text{train}},y_{ \text{train}})\)
3: Compute class weights: \(w_{c}=\frac{n}{|C_{c}|}\quad\forall c\in\{0,1\}\)
4: Define ResRNN-Net: \(\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad \quad\quad\quad\quad\quad



#### 3.8.2 Multimodal Model

To predict pregnancy complications, convolutional neural networks (CNNs) are designed for ultrasound images, long short-term memory (LSTM) networks for electrohysterogram (EHG) time series, and multi-layer perceptron (MLP) networks for patient health data are used. The overall architecture is shown in Figure 11.

**Data Preprocessing and Balancing:** Fetal ultrasound images were resized to \(224\times 224\) pixels, normalized, and augmented for CNN training.