# Biometric-Based Human Identification Using Ensemble-Based Technique and ECG Signals
## 3 Materials and Methods
### Deep Features Extraction from Spectrogram  
For feature extraction, a VGG16 model has been used. VGG-16 is a popular deep convolutional neural network (CNN) architecture that is 16 layers deep. VGG-16 is known for its ability to extract hierarchical features from images. Since this work uses a deep neural network pre-trained on images as a feature extractor for ECG signals, the data instances must be transformed into images. So, we use spectrograms. Spectrograms can capture the changes in the signal's power in a photo by taking the Fourier transform of each partition of the movement. To extract the feature vectors from the spectrograms, we acquired a Keras implementation of VGG16. The VGG16 pre-trained weights and model were used. We add a global average pooling layer to the model's output to remove features using this pre-trained model on spectrogram images. Extracting features using the VGG-16 model from a 2D spectrogram image involves passing the image through the pre-trained VGG-16 model and capturing the intermediate feature representations from specific model layers. The concept of transfer learning (TL) [57] serves as a strategic framework within the domain of deep learning (DL), enabling the application of insights garnered from one issue to address a comparable challenge in another context. Transfer learning methods can generally be categorized into four groups: instance-based, parameterized, feature-representation, and relational knowledge transfer. Among these, the feature-representation transfer learning approach is well-suited for the task. In our proposed method, a pre-trained convolutional neural network (CNN) such as VGG-16 is employed to extract domain-independent image features, thereby enhancing the transferability of knowledge from a source to a target domain. Pre-trained models are combined with fine-tuning techniques to adapt them to new tasks. This involves adding supplementary layers to accommodate new classes, a process we adopt in our approach through fine-tuning. Here, a pre-trained model is extended using fine-tuning to align with the requirements of a novel dataset, obviating the need for training from scratch and expediting the process. Additional layers are adjusted during training to optimize the model's performance, aligning it with the dataset's characteristics. Fine-tuning is executed with a minimal learning rate to ensure minimal disruption to the previously acquired knowledge. Starting with freezing all layers and only learning the final classifier, we gradually unfreeze and modify more layers top-down. Increasingly unfreezing layers may enhance network performance, but excessive unfreezing can lead to diminished effectiveness due to limited data. Overfitting, a concern when training on limited data, is managed using strategies like dropout layers and L2 regularization. The methodology is demonstrated using the VGG16 model, with its initial weights as the starting point. After global average pooling, a dropout layer is incorporated, and L2 regularization is employed to prevent overfitting. The model's training weight from ImageNet is adopted to establish a strong foundation. Since our task involves binary classification, we utilize the binary cross-entropy logarithmic loss function to optimize model performance and guide its learning process. The pseudocode for this step is shown in Algorithm 2. ```
Step 1: Input: images after applying single-level Short-Time Fourier Transformation Step 2: Output: important features Step 3: Import the required libraries (Keras) Step 4: Load the pre-trained model (VGG16) using the Keras application module. Step 5: Define a new model that takes the output of the pre-trained model as input and adds additional layers to perform feature extraction (Global Average Pooling2D Layer)
```