# Perturbation-Based Explainable AI for ECG Sensor Data
## 5 Model Explanations
### Evaluation and Discussion  
Based on communication with experts, we selected a subset of diagnoses from the data. This subset had to meet several conditions. The selected diagnosis had to have a sufficient number of cases (more than 400) in the data; at the same time, the quantitative metrics of selected diagnoses had to meet sufficient values (F1-score greater than 0.4, accuracy greater than 0.6). Experts had to be able to identify and know the given diagnoses. Thus, the selected diagnoses had to have been included in the study materials of the selected students. Diagnoses described in the recommended study materials for medical students according to [14] were the following:  
* Sinusoidal rhythm (SNR)
* Sinus bradycardia (SB)
* Sinus tachycardia (STach)
* Abnormal T wave (TAb)
* Long QT syndrome (LQT)
* Atrial fibrillation (AF)
* Blockade of the right Tawar branch (RBBB)
* Lowered amplitude of the QRS complex (LQRSV)
* First-degree AV block (IAVB). Verification was based on the assumption that if the method correctly provides explanations for a subset of the target attribute values, it will correctly provide it for the rest. The correctness of the explainability methods was verified using a short questionnaire and an interview with the respondents. The questionnaire contained a series of ECG recordings with the XAI_FOR_INVIDUAL_LEAD interpretability method applied. The method of explainability of the most important lead is based on the assumption that certain ECG leads are more important for predicting certain diagnoses. The reason for this is that diagnoses are based on certain parts of the ECG wave. Each ECG lead looks at the heart from a different angle and sees the part of the heart that is closest to the lead. The verification process was as follows:  
1. Calculate the most important lead using the MOST_IMPORTANT_LEAD function on all cases of selected diagnoses in the test data. Only one most important lead is  
Figure 5: An example of the output of the MOST_IMPORTANT_LEAD function. Representation of the most important leads for the prediction of long QT syndrome is visualized in the form of a table and a bar plot. selected for one case. The number of cases in which individual leads were the most important for each diagnosis is counted. 2. The relevance of identified most important leads with individual diagnoses has been confirmed in most of the cases. Connections of the most important leads with diagnoses were acknowledged based on communication with the expert: * Sinus bradycardia (SB)--U wave in leads (aVR, V2, V4-6) may be present in bradycardia. * Sinus tachycardia (STach)/Long QT syndrome (LQT)--P waves positive in leads I and II (these are the basic sign of sinus rhythm, which is important for the diagnosis of tachycardia). * Abnormal T wave (TAb)--Low QRS voltage negative inverted T waves are often seen in lead III. * Atrial fibrillation (AF)--ST depression and negative T waves in the lateral leads (I, aVL, V5, V6), [PERSON]'s phenomenon (V5 lead). * Blockade of the right Tawar branch (RBBB)--RBBB is best \"looked\" at through leads V1-V5. * First-degree AV block (IAVB)--leads I and II are used for diagnosis, as they can detect a positive Physiological P wave. 3. The relevance of the identified most important leads was refuted in the following cases based on communication with the expert: * Sinus Rhythm (SNR)/Sinus Bradycardia (SB)/Sinus Tachycardia (STach)/Long QT Syndrome (LQT)--generally, Lead II is considered the best lead for finding atrial activity. * Lowered amplitude of the QRS complex (LQRSV)--AVL lead is not related, as it uses the Sokolow index for diagnosis, which uses leads (V1/V2/V5/V6). Based on the confirmed connections of the leads with individual diagnoses, the correctness of the explainability method was confirmed. The MOST_IMPORTANT_LEAD function considered the same leads to be important as the experts in the given area.