## 3 Proposed Method  
In this study, our focus is on the classification of bipolar disorder and schizophrenia from MR images by utilizing deep learning-based methods. The proposed method involves a multi-stage approach to classify MR images for prediction. To achieve this, advanced deep learning techniques are applied for feature extraction, analysis, and selection. Additionally, we employ feature fusion and selection methods to enhance the model's classification performance and reduce the dimension of the data. Let \(X=[x_{1},\,\ldots,\,x_{N}]\) represent a whole dataset, where \(x_{n}\in\mathbb{R}^{224\times 224}\) and \(n\) represents the sample number. Therefore, the primary objective in this classification problem is to find a nonlinear mapping function, \(f(\cdot)\), that matches a feature set to a predefined labeled class. As illustrated in Figure 2, the workflow begins with the training of a ResNet-50 model on MR images. After training a fine-tuned ResNet-50, we analyze it with Gradient-weighted Class Activation Mapping (Grad-CAM) to extract the important regions on MR images that mostly affect the prediction of bipolar disorder and schizophrenia. These important regions are used to extract features from MR images. The features derived from the Grad-CAM-identified regions were combined with the global features extracted from the ResNet-50 model. This comprehensive feature set was then refined through feature selection to retain only the most important features that contributed to performance improvement. For this purpose, ElasticNet was employed, leveraging its advanced architecture to identify and prioritize key features. The selected features were subsequently given as input into a deep neural network (DNN) whose hyperparameters were optimized using Bayesian optimization, ensuring robust and efficient final classification. Let \(f_{k}^{n}\) denote an individual feature derived from a single MR image sample. Thus, \(f^{n}=\big{(}\ f_{1}^{n},\ f_{2}^{n},\ f_{3}^{n},\,\ldots,\,f_{K}^{n}\big{)}\) represents all the features obtained from an MR image. Features extracted from a single sample using the ResNet-50 model and region-based features derived from important regions identified by Grad-CAM, as shown in Figure 2, can be represented by \(f_{R}\in\mathbb{R}^{2048\times 1}\) and \(f_{G}\in\mathbb{R}^{17\times 1}\), where the sub-indices \(R\) and \(G\) correspond to ResNet-50 and Grad-CAM-based region features, respectively. Then, a feature fusion method is employed, and all features from a single sample are concatenated into a combined vector, denoted as \(f_{FF}\in\mathbb{R}^{2065\times 1}\). To improve the system's performance and reduce features that can increase computation time, we apply a feature selection method. After feature fusion, we employ the ElasticNet method on the concatenated features extracted from the ResNet-50 model and Grad-CAM-based features. By utilizing this method, we reduce the dimension of features from 2065 to 512 by applying feature selection, and the  
Figure 1: 224 \(\times\) 224 resized MR images of patients with bipolar disorder (**left**) and schizophrenia (**right**). final features are represented as \(f_{ElasticNet}\in\mathbb{R}^{512\times 1}\). Finally, these selected features are fed into a Bayesian-optimized DNN to classify the psychological disorders. **ResNet:** ResNet-50 is a residual network consisting of 50 layers, introduced by [40]. Its primary innovation lies in the use of residual connections. The architecture of ResNet is composed of numerous residual blocks, each of which includes several convolutional layers. After the convolutional layers, batch normalization and rectified linear unit (ReLU) activation functions are employed. ResNet is distinguished from CNN by identity mapping, which is given by (1):  
\[y=F(x)+x, \tag{1}\]  
where \(x\) and \(F(x)\) represent the input and the learned residual function, respectively. If a network grows deeper, accuracy can decrease because of vanishing or exploding gradients.