## 3 Architectural System Design
### System Architecture
#### 3.8.1 ResRNN-Net and MultiScaleFusion-Net
Electrohysterogram (EHG) signals were resampled, min-max-scaled, and class-balanced using SMOTE. Tabular data underwent imputation, feature normalization, and LASSO-based selection to ensure seamless integration across modalities. **Model Development:** The multimodal model consists of three key components:

* **Convolutional Neural Networks (CNNs)**: Used for analyzing ultrasound images and detecting fetal anomalies. \[\mathbf{Z}^{(l)}=\text{ReLU}\Bigg{(}\sum_{c=1}^{C}\mathbf{W}_{c}^{(l)}*\mathbf{ X}_{c}+b^{(l)}\Bigg{)}\] (2) (Convolution + ReLU activation: implemented as nn.Conv2d followed by nn.ReLU()) \[\mathbf{P}^{(l)}=\text{MaxPool}\Big{(}\mathbf{Z}^{(l)}\Big{)}\] (3)(Pooling operation: nn.MaxPool2d) \[\mathbf{f}_{\text{CNN}}=\text{Flatten}\Big{(}\text{AdaptiveAvgPool}(\mathbf{P}^{(L)}) \Big{)}\] (4) (Final [-25]feature vector via global pooling and flattening: nn.AdaptiveAvgPool2d + nn.Flatten)
* **Long Short-Term Memory (LSTM) Networks**: Used for processing EHG time-series data and detecting uterine contraction patterns. \[\mathbf{i}_{t}=\sigma(\mathbf{W}_{i}\mathbf{x}_{t}+\mathbf{U}_{i}\mathbf{h}_{t -1}+\mathbf{b}_{i})\] (5) (Input gate computation) \[\mathbf{f}_{t}=\sigma\Big{(}\mathbf{W}_{f}\mathbf{x}_{t}+\mathbf{U}_{f} \mathbf{h}_{t-1}+\mathbf{b}_{f}\Big{)}\] (6) (Forget gate computation) \[\mathbf{o}_{t}=\sigma(\mathbf{W}_{o}\mathbf{x}_{t}+\mathbf{U}_{o}\mathbf{h}_{t -1}+\mathbf{b}_{o})\] (7) (Output gate computation) \[\mathbf{g}_{t}=\tanh(\mathbf{W}_{g}\mathbf{x}_{t}+\mathbf{U}_{g}\mathbf{h}_{t -1}+\mathbf{b}_{g})\] (8) (Candidate cell state) \[\mathbf{c}_{t}=\mathbf{f}_{t}\odot\mathbf{c}_{t-1}+\mathbf{i}_{t}\odot \mathbf{g}_{t}\] (9) (Updated cell state) Figure 11.0 (10) (Hidden state) Figure 11.1 (11) (Final LSTM output: implemented using nn.LSTM, taking last hidden state)
* **Multi-Layer Perceptron (MLP)**: Used for structured tabular data, capturing demographic and clinical factors. Figure 11.2 (12) (First dense layer with ReLU activation: nn.Linear + ReLU) Figure 11.3 (13) (Second dense layer, producing final tabular embedding) Outputs from MLP (Figure 12), CNN (Figure 13), and LSTM (Figure 14) models are fused in a shared integration layer before making final predictions. This fusion mechanism ensures that tabular, spatial, and temporal information contributes to more accurate predictions. Figure 11.4 Proposed deep learning system for pregnancy risk prediction. (i) **ResRNN-Net**: combines Bi-LSTM and CNN to capture temporal and spatial features, followed by attention-based fusion and dense layers for classification. (ii) **MultiScaleFusion-Net**: utilizes parallel Conv1D layers at different scales, followed by GRU and dense layers to extract hierarchical features for final prediction. Figure 11.5 Multi-layer perceptron (MLP) network architecture. Figure 11.6

Figure 11.7

**Training and Evaluation:** The model was trained using the Adam optimizer (learning rate = 0.0005) and a batch size of 16/32. Early stopping (patience = 3 epochs) prevented overfitting, while the ReduceLROnPlateau scheduler dynamically adjusted the learning rate upon performance plateau. A 5-fold stratified cross-validation approach was applied to ensure model robustness across different data distributions. **Performance Metrics and Explainable AI:** SHAP was used for interpreting feature contributions in tabular and time-series inputs, while Grad-CAM visualizations provided heatmaps highlighting critical regions in ultrasound images, ensuring model transparency. ### Ethical Considerations

This study utilized the publicly accessible and fully anonymized NFHS-5 dataset, provided by the Ministry of Health and Family Welfare, Government of India. As a secondary dataset, it contains no personally identifiable information, and no direct interaction with human subjects occurred. All preprocessing and analysis steps were conducted in accordance with data privacy regulations (Figure 15). Figure 11.8 Long short-term memory (LSTM) network architecture. Figure 11.9 Convolutional neural network architecture.