0
$\begingroup$

I am working with ECGs and trying to use a CNN model to perform binary classification. The goal is to classify 30s ECGs to detect a specific disease. I am using CNN and converting ECGs to images (scalograms). Unfortunately, the amout of with the specific disease are not enough thus I am plannign to split the 30s ecgs to multiple 10s ecgs (overlapping) becuase I have a larger dataset with 10s ecgs thus I can train my model.

I have trained my model on a dataset and tested on a different dataset that has 10s long ecgs. The model perfomed well. Eventhough, that the 10s dataset has a ratio of 1:9, I have created a balance training dataset and then tested on the testing dataset. The model had a good F1 score.

However, when I tried to classify 30s ecgs using the method described above most of the data are classifies as label 1 (diseas detected) and almost none as label 0.

PS: I convert the ecgs to RGB images (scalograms), which give information about the time-frequency domain PS 2: My dataset is about 90% of images of label 0 (both 10s dataset and 30s dataset) however, when tested on the 30s dataset most of the data are classified as label 1. Need to mention that when trained I carefully choosed data to create a balanced dataset for training.

Does anyone has any suggestions?

Thank you in advance.

$\endgroup$
7
  • $\begingroup$ Are your 10s records skewed toward one of the two classes? If so, which class and in what ratio? $\endgroup$
    – Dave
    Commented Jan 9, 2023 at 18:47
  • $\begingroup$ Unfortunately as with every medical dataset, the dataset was imbalance. So my dataset consist of multiple normal ecgs, then some ecgs with the disease I want to detect and then some other types of diseases. I have converted it to binary and by including the other types of diseases I allowed my model to become more flexible. I made the trainng dataset balanced but the testing dataset had the rest. Howver, it reached a high accuracy (relatively) of close 80% in the testing dataset. $\endgroup$
    – makala
    Commented Jan 9, 2023 at 19:16
  • $\begingroup$ What’s unfortunate about imbalance? // What is the imbalance ratio on the 10s ECGs? The 30s ECGs? $\endgroup$
    – Dave
    Commented Jan 9, 2023 at 19:16
  • $\begingroup$ For the 10s ECG, in the training dataset I had a ratio 1:1 and in the testign dataset I had a ratio 719:4419. In the 30s dataset the ratio is 822:2500. However, when classifying in the 30s dataset, almost 98% of the data are labelled as 1 and barely any are labelled as 0 $\endgroup$
    – makala
    Commented Jan 9, 2023 at 19:21
  • $\begingroup$ Why does the test dataset have imbalance while the training dataset lacks imbalance? Are you using some kind of artificial balancing to remove imbalance from your training set? Good statistical methods dispute that imbalance is a problem in need of solving in all but some fringe cases that your scenario does not appear to be. // Let’s set aside data manipulations you’re doing and if they’re wise. In all of your 10s records, what is the ratio of the two classes? $\endgroup$
    – Dave
    Commented Jan 9, 2023 at 19:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.