# The Multi-Branch Deep-Learning-Based Approach to Heart Dysfunction Classification
## 1 Introduction  
Cardiovascular diseases (CVDs) are one of the most common causes of death globally. An electrocardiogram (ECG) signal representing the heart's electrical activity is widely used to detect and classify cardiac arrhythmias. Visual inspection of the ECG waveform allows anomalies to be detected. It is crucial in the early stages of heart disease when symptoms occur only occasionally. In such cases, continuous monitoring by wearable devices and an automatic classification process increase the chances of proper detection. To increase the efficiency of ECG analyses, methods for automatic detection of ECG abnormalities are used instead of a physician visually reviewing the ECG waveform periodically. This way, when the algorithm detects disease signals, it classifies them, and the doctor can be notified. Originally, algorithms based on morphological features and classical signal-processing techniques were commonly used. However, these solutions turned out to be insufficient, as the ECG waveform's morphological characteristics can have high variability between different patients and are susceptible to interference during measurement [1,2]. Nowadays, deep-learning-based algorithms using recurrent neural networks (RNNs) and convolutional neural networks (CNNs) dominate the field [1,3, 4, 5]. Recent publications provehybrid or extended variations of said architectures [6; 7] to excel in the ECG analysis task. Another approach gaining traction is the use of attention-based models, whereby employing convolutional layers combined with attention, the CNN autonomously extracts detailed morphological and temporal patterns from raw multi-lead ECG data--often removing the need for handcrafted features while delivering higher accuracy and robust cross-dataset performance [8; 9]. Also, there are different competing techniques used, such as multi-head attention, channel-self attention, additional input modalities as a second branch, or two-phase networks, used to improve CNN performance for medical diagnosis problems [8; 10; 11; 12; 13]. Dual-branch allows for different input modalities (often raw signal and FFT) or filters of different sizes on separate input branches to improve results by ensuring that diverse information is processed in parallel, and the network can learn fine-grained and coarse features simultaneously. Channel attention uses an attention model to filter out redundant ECG signal features and allows the network to learn inter-channel dependencies. However, it can increase complexity and the risk of overfitting. Network combined with a transformer uses a neural network to learn local dependencies and an attention mechanism to learn global (or inter-beat) dependencies. These solutions are often more complex to tune and slower to train. More on each approach and their efficiency for different medical problems can be read in [14; 15]. Multimodal data integration is also becoming more common to provide better input for network-based diagnosis of medical problems [16]. In [17; 18], a two-branch architecture with two blended sub-networks and wavelet analysis was shown as superior to common N-BEATS, LSTM, and GRU architectures. In this article, this idea is further developed into a new architecture model, and instead of adding domain knowledge or other information as a single input with the ECG signal, a multi-branch architecture is proposed with up to 6 branches containing different inputs, like the raw signal, domain knowledge, the wavelet transform of the signal, or drift removal. In Table 1, the comparison between input modalities and techniques used in different solutions is shown. The most popular solutions were used as input for independent branches (as shown in Figure 1). Multi-branch architecture containing independent branches proved to obtain better results in all tested scenarios, improving the overall performance of neural networks. The paper uses three basic neural networks (LSTM, GRU, and N-BEATS) used interchangeably. For the sake of clarity, they will be denoted as _core networks_.