## 3 Methodology  
There are several benefits to using spectrogram images in deep learning (DL) image classification tasks, especially when dealing with time-series data such as electrocardiogram (ECG) signals. Spectrograms convert ECG signals into a visual representation, essentially turning a time-series problem into an image classification problem. This allows us to leverage the power and well-established techniques of convolutional neural networks (CNNs), which have been highly successful in image recognition. CNNs can automatically learn the relevant features from the spectrogram image itself. This eliminates the need for manual feature engineering, which can be a complex and time-consuming process for data. Also, since spectrograms are already visual representations, they often require less preprocessing compared to raw data. This can save time and resources during the model development process. Moreover, unlike traditional images, spectrograms are often less affected by factors like background noise or slight variations in size. This can lead to more robust models. Overall, spectrograms offer a powerful approach for applying deep learning techniques to classification tasks. They can lead to more accurate and efficient models by leveraging the strengths of CNNs and reducing the need for manual feature engineering. This work introduces a new deep learning spectrogram-based model for the classification of electrocardiogram (ECG) signals using feature fusion from the output of 3 CNN channels. As shown in the flowchart in Figure 6, at the data preprocessing stage, the proposed methodology converts the ECG time-series signal into a spectrogram image using a short-time Fourier transform (STFT). The spectrogram image is resized to 128 \(\times\) 128 pixels and then used to generate another two images using HOG and LBP algorithms. The HOG and LBPs are often superior for feature extraction due to their efficiency and robustness. The HOG is excellent at detecting edges and shapes, making it effective for tasks like object detection while being robust to lighting variations. LBP excels in capturing local textures and is computationally efficient, making it ideal for texture classification. Both methods are resilient to changes in illumination, rotation, and scale, making them suitable for real-world applications where other descriptors may struggle with these variations. A 3 \(\times\) 3 window size is used in both algorithms to generate the corresponding HOG and LBP images. Eight neighboring pixels in the LBP calculation and nine angle ranges in the HOG calculation were assigned as parameter values. Sample spectrogram images from the database and their corresponding LBP and HOG images are shown in Figure 5. After thepreprocessing stage, the dataset is split into training and testing sets. For the training stage, the three images generated are used as inputs to a 2D convolutional neural network (CNN) model, which is a type of deep learning algorithm that is particularly effective for image classification tasks. To further enhance performance, a gated recurrent unit (GRU) model is added after the CNN model. A GRU is a type of recurrent neural network (RNN) that allows for the modeling of sequential data, making it ideal for analyzing time-series data such as ECG signals. After the classification model, the decision will be made to classify the input signal into one of the \(N\) classes (\(N=3\) or 5 classes) based on the dataset used. This study developed a 3-channel CNN + GRU architecture with three input images. The architecture is designed such that each channel handles one of the three images: one for the RGB spectrogram image, another for the LBP image, and the last for the HOG image. In the proposed approach, each of the three input images is fed through its corresponding feature extraction module (FEM) in parallel. The FEM consists of 5 feature extraction (FE) blocks (see Figure 7). Figure 6: The flowchart of the proposed model for ECG signal classification. \(N=3\) or 5 classes depending on the dataset used.