## 4 Results
This technique introduces rotational invariance, enabling the model to better handle variations in image orientation. Additionally, random horizontal and vertical flips were used to diversify the spatial orientation of the training data. On the other hand, brightness is adjusted to a value from 0.85 to 1.35, which supplies different lighting conditions to increase the adaptability of the model to different brightness variations. Finally, each pixel value was rescaled by a factor of 1/255 to normalize the input data of the model. This data augmentation approach increased the variability of the training dataset. By simulating a range of real-world variations, these transformations improved the robustness of the model and enhanced its generalization. **Model Workflow:** The first model utilized in this study is based on the ResNet50V2 architecture. The ResNet50V2 model was initialized with pre-trained weights on the ImageNet dataset. We apply a fine-tuning strategy to train the network. For this purpose, we freeze the initial 75 layers of the ResNet50V2 architecture. This step ensures that the lower-level feature extractors, which capture general patterns such as edges and textures, remain intact and unchanged. By freezing these initial layers, the model can utilize the robust pre-learned features acquired from training on the ImageNet dataset. This also reduces the number of trainable parameters, leading to a more efficient training process and decreased computational cost. Moreover, to adapt ResNet-50 to our problem, the model's top fully connected layers were excluded, enabling the integration of custom layers to fine-tune the network. Specifically, a GlobalAveragePooling2D layer was added to reduce the feature map dimensions and to overcome overfitting. After that, we utilize a fully connected layer, which has 128 units, and a ReLU activation function. Besides, L2 regularization is utilized to increase the model's generalization. A dropout layer is added to avoid the overfitting problem during training, and we set the dropout rate as 0.2. Then, the sigmoid activation function is used at the output layer of the network. To train the model, we employ the Adam optimizer and choose the learning rate of the optimizer as 0.00005. On the other hand, the loss function is selected as the binary cross-entropy loss function, which is compatible with the sigmoid activation function at the last layer. The results obtained using fine-tuned ResNet-50 model are presented in Table 1.  
In this study, Grad-CAM was employed to identify the important regions in MR images that contributed most significantly to the classification of bipolar disorder and schizophrenia. Figure 3a,b illustrates sample images from individuals diagnosed with SCH, bipolar disorder, and their corresponding Grad-CAM heatmap results. As shown in Figure 4, the Grad-CAM heatmaps highlight the areas within each image that the model focused on during classification. After the heatmap is created, in order to identify the regions of interest highlighted by Grad-CAM, we apply a threshold value to the generated heatmap. If both red and green channel intensities exceed a value of 125, these areas are selected as important regions. This threshold value was determined through trial and error. In cases where two independent regions are identified, the region with the higher average intensity within its bounding box is prioritized as the primary area of interest. After that, we extract region-based features from the important areas determined by Grad-CAM. These features are area, centroid, eccentricity, orientation, extent, perimeter, solidity, major axis length, minor axis length, convex area, Euler number, and equivalent diameter. In addition to region-based features, statistical features such as minimum, maximum, variance, and entropy are also extracted from the important regions. The performance of the proposed method is evaluated with various deep learning and machine learning models to classify bipolar disorder and schizophrenia.