## 3 Proposed Approach
### Class Weights
#### 3.3.2 Auto Encoder (AE)  
Auto encoder is tailored for both binary and multi-class classification tasks, starting with an input layer that accepts feature vectors. It features an encoder composed of several dense layers that progressively reduce the input's dimensionality while applying the ReLU activation function, effectively extracting important features from the data. For binary classification, a classification layer follows, using the sigmoid activation function, while for multi-class classification, it uses the softmax activation function, enabling the model to output class probabilities for the respective scenarios. The model is compiled with the Adam optimizer and employs binary cross-entropy loss for binary tasks and categorical cross-entropy loss for multi-class tasks, ensuring appropriate loss calculations for each classification type. Additionally, a callback is implemented to adjust the learning rate based on validation loss, facilitating improved convergence and minimizing the risk of overfitting. The training and validation accuracies are plotted across epochs to evaluate the model's performance in both classification contexts. The encoder layers progressively reduce the dimensionality of the input data, extracting important features through dense layers. This dimensionality reduction and feature extraction process can be mathematically expressed as shown in Equation (14) [89]. \[h^{(l)}=f\left(W^{(l)}\,a^{(l-1)}+b^{(l)}\right) \tag{14}\]  
In this formulation, \(h^{(l)}\) denotes the output of the encoder layer \(l\), while \(a^{(l-1)}\) represents the output from the previous layer, serving as the input for the first layer. The weight matrix for layer \(l\) is indicated by \(W^{(l)}\), and \(b^{(l)}\) denotes the bias vector for that layer. The activation function applied is denoted as \(f\), which is specifically the ReLU function in this context. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Binary Classifier** & **Multi-Class Classifier** \\ \hline Batch size & 128 & 128 \\ \hline \multirow{3}{*}{Learning rate} & Scheduled: Initial = 0.001, & Scheduled: Initial = 0.001, \\  & Factor = 0.5, Min = 1 \(\times\) 10\({}^{-5}\) & Factor = 0.5, Min = 1 \(\times\) 10\({}^{-5}\) \\  & (ReduceLROnPlateau) & (ReduceLROnPlateau) \\ \hline Optimizer & Adam & Adam \\ \hline Loss function & Binary cross-entropy & Categorical\_crossentropy \\ \hline Metric & Accuracy & Accuracy \\ \hline \hline \end{tabular}
\end{table} 
Table 20: Hyperparameters for CNN model. In a standard auto encoder, the decoder layer reconstructs the input from the compressed representation learned by the encoder. This reconstruction process can be mathematically represented as detailed in Equation (15) [89]. \[\overset{\prime}{\alpha}=g\,\left(W^{(d)}\,h^{(l)}+b^{(d)}\right) \tag{15}\]  
In this context, \(\hat{\alpha}\) represents the reconstructed output, while \(h^{(l)}\) is the output from the last encoder layer. The weight matrix for the decoder layer is denoted as \(W^{(d)}\), and \(b^{(d)}\) indicates the bias vector for the decoder layer. The activation function used for the decoder is represented by \(g\), which is typically linear for reconstruction purposes. The classification layer utilizes a specific activation function for binary classification output. This can be expressed as presented in Equation (16) [89]. \[\overline{y}=\sigma\left(W^{(out)}\,h^{(l)}+b^{(out)}\right) \tag{16}\]  
In this framework, \(\overline{y}\) denotes the predicted probability for the positive class. The weight matrix for the output layer is represented by \(W^{(out)}\), while \(b^{(out)}\) signifies the bias for the output layer. The sigmoid function, denoted as \(\sigma\), is employed to map the output to a probability score between 0 and 1. For multi-class classification output, the classification layer employs the softmax activation function, which enables the model to generate a probability distribution across multiple classes. This can be expressed as presented in Equation (17) [92].