# Achieving Excellence in Cyber Fraud Detection: A Hybrid ML+DL Ensemble Approach for Credit Cards
## 4 Method
### Deep Learning Techniques  
The model architecture consists of 18 layers, each contributing uniquely to the feature extraction and classification process:  
1-Conv1D Layer: The architecture begins with a one-dimensional convolutional layer equipped with 32 filters and a kernel size of 3. This layer utilises the ReLU activation function to introduce non-linearity and efficiently capture local patterns in the input sequence. The input shape for this layer is defined as (X_train.shape [1], 1), where X_train.shape [1] represents the number of features in each input sample. 2-Batch Normalisation Layer: Immediately following the first Conv1D layer, Batch Normalisation is applied. This technique normalises the activations of the previous layer; by minimising internal covariate shift, the training process is substantially improved in terms of stability and efficiency. It helps in maintaining a consistent distribution of inputs across layers. 3-MaxPooling1D Layer: The MaxPooling layer is implemented to downscale the feature maps, with a pool size of 2. This layer reduces the spatial dimensions and retains the most significant features while mitigating the computational load and helping to prevent overfitting. 4-Conv1D Layer: The model then incorporates a second Conv1D layer with 64 filters and a kernel size of 3. This layer continues to capture more complex patterns, building on the representations learned by the first convolutional layer. 5-Batch Normalisation Layer: Like the first set of layers, Batch Normalisation is applied to further stabilise the learning process and reduce the dimensionality of the feature maps. 6-MaxPooling1D Layer: Another MaxPooling layer is applied to downsample the feature maps, retaining the most important features while reducing computational complexity and preventing overfitting. 7-Conv1D Layer: The filter size is increased to 128 in the third Conv1D layer, which also maintains a kernel size of 3. This layer allows the model to learn even more abstract and higher-level features from the input sequence, which are crucial for accurate classification. 8-Batch Normalisation Layer: Batch Normalisation is applied again to ensure stable and efficient learning by normalising the activations. 9-MaxPooling1D Layer: A third MaxPooling layer is applied to further reduce the spatial dimensions of the feature maps, retaining the most critical features. 10-Bidirectional LSTM Layer: Following the convolutional layers, the model employs a Bidirectional LSTM (BiLSTM) layer with 128 units. Unlike traditional LSTMs, The BiLSTM algorithm processes the input sequence in both the forward and backward orientations, allowing the model to incorporate dependencies from both past and future contexts. This bidirectional processing is particularly beneficial for understanding the sequential nature of the data and for improving the context-awareness of the model. 11-Dropout Layer: To prevent overfitting, a Dropout layer with a dropout rate of 0.5 is added after the first BiLSTM layer. Randomly, 50% of the neurons are removed during each training iteration using this technique. 12-Bidirectional LSTM Layer: Another Bidirectional LSTM layer with 64 units is then included, providing a more compact representation of the sequential data while still benefiting from bidirectional context. 13-Dropout Layer: An additional Dropout layer with the same dropout rate of 0.5 is applied after the second BiLSTM layer to further reduce overfitting and improve model robustness. 14-Attention Layer: The Attention Layer computes a context vector by focusing on the most relevant parts of the sequence. This layer works by assigning higher weights to the time steps that contribute more significantly to the output prediction. This mechanism enhances the model's interpretability and efficiency by allowing it to focus on the most informative segments. 15-First Dense Layer: An attention-driven fully linked layer with 64 neurons and ReLU activation. This layer incorporates features from preceding levels to teach the model complicated feature interactions.