## 4 Materials and Methods
### DL and ML Classification  
Prior to training and testing the LWCNN, pre-trained, and EML [58] models, we fine-tuned different types of parameters for better prediction and to minimize model loss. To compute the feature maps in each convolutional layer, a non-linear activation function (ReLU) was used, and the equation can be defined as:  
\[A_{i,j,k}=\text{max}\big{(}w_{n}^{T}I_{i,j}+b_{n},0\big{)} \tag{1}\]  
where \(A_{i,j,k}\) is the activation value of the \(n\)th feature map at the location \((i,j)\), \(I_{i,j}\) is the input patch, and \(w_{n}\) and \(b_{n}\) are the weight vector and bias term, respectively, of the \(n\)th filter. BN was also used after each convolution layer to regularize the model, reducing the need for dropout. BN was used in our model because it is more effective than global data normalization. The latter normalization transforms the entire dataset so that it has a mean of zero and unit variance, while BN computes approximations of the mean and variance after each mini-batch. Therefore, BN enables the use of the ReLU activation function without saturating the model. Typically, BN is performed using the following equation:  
\[\text{BN}\;(X_{normalize})=(x_{n}-\mu_{mb})/\sqrt{\sigma_{mb}^{2}}+c \tag{2}\]  
where \(x_{n}\) is the \(d\)-dimensional input, \(\mu_{mb}\) and \(\sigma_{mb}^{2}\) are the mean and variance, respectively, of the mini-batch, and \(c\) is a constant. To optimize the weights of the network and analyze the performance of the LWCNN models, we performed a comparative analysis based on four different types of optimizers, namely stochastic gradient descent (SGD), Adadelta, Adam, and RMSprop. The results of comparative analysis are shown in the next section. The classification performance is measured using the cross-entropy loss, or log loss, whose output is a probability value between 0 and 1. To train our network, we used binary cross-entropy. The standard loss function for binary classification is given by:  
\[Binary_{loss}=-\frac{1}{N}\sum_{i=1}^{N}[Y_{i}\,\times\,\log(M_{w}(X_{i}))+( 1-Y_{i})\,\times\,\log(1-M_{w}(X_{i}))] \tag{3}\]  
where \(N\) is the number of output class, \(X_{i}\) and \(Y_{i}\) are the input samples and target labels, respectively, and \(M_{w}\) is the model with network weight, \(w\). The hyperparameters were tuned while setting a minimum learning rate of 0.001 using the function known as ReduceLROnPlateau, a factor of 0.8 and patience of 10 were set; thus, if no improvement was observed in validation loss for 10 consecutive epochs, the learning rate was reduced by a factor of 0.8. The batch size was set to eight for training the model and regularization was applied by dropping out 25% and 50% of the weights in the convolution and dense blocks of LWCNN, respectively. The probabilistic output in the dense layer was computed using sigmoid and softmax classifiers. In addition to CNN methods, traditional ML algorithms including logistic regression (LR) [59] and random forest (RF) [60] were used for features classification. In this paper, an ensemble voting method was proposed in which LR and RF classifiers were combined to create an EML model. This ensemble technique was used to classify the handcrafted and non-handcrafted features and compare the classification performance. The LWCNN, pre-trained, and EML models were tested using the unknown or unseen data samples. Typically, for ML classification, cross-validation was used by splitting the training data into \(k\)-fold (i.e., \(k=5\)) to determine the model generalizability, and the result was computed by averaging the accuracies from each of the k trials. Prior to ML classification [61; 62; 63], the feature values for training and testing were normalized using the standard normal distribution function, which can be expressed as:  
\[P_{i,Normalised}=\frac{P_{i}-\mu}{\sigma} \tag{4}\]where \(P_{i}\) is the \(i\)th pixel in an individual tissue image, and \(\mu\) and \(\sigma\) are the mean and standard deviation of the dataset.