dimensions of its capability, from monitoring
cardiovascular health amid the COVID-19 pandemic
to detecting heart abnormalities.
An innovative study integrated 5G technology
into a real-time cardiovascular monitoring system
tailored for COVID-19 patients (Tan, 2021). Utilizing
a combination of convolutional neural networks
(CNNs) and long short-term memory (LSTM)
networks, the research achieved a prediction accuracy
of 99.29%, illustrating the potential of real-time
monitoring and deep learning in COVID-19 patient
care.
Another study used a one-dimensional CNN (1D-
CNN) for classifying various types of ECG rhythms
and beats (Darmawahyuni , 2022). The model, trained
on multiple databases, boasted an impressive
accuracy of 99.98%, thereby demonstrating the
power of deep learning in diagnosing complex heart
abnormalities.
Arrhythmia Classification Focusing on the
classification of arrhythmias into five categories, a
particular study employed deep convolutional neural
networks and used a well-established arrhythmia
database for training (Raza, 2022). The model
attained an accuracy of up to 98.9% with clean data,
emphasizing the effectiveness and reliability of
machine learning in heart disease diagnosis.
COVID-19 Detection Based on ECG Two studies
specifically tackled the early detection of COVID-19
through ECG trace images (Shahin, 2021) (Attallah,
2022). One study tested multiple CNN architectures
and found one model to outperform the others with an
89.64% accuracy rate. Another study examined a
broader array of deep learning algorithms and
achieved an accuracy rate of 98.8% in binary
classification scenarios.
Beyond ECG: Other Applications in COVID-19
Detection Research has also extended into other
diagnostic methods for COVID-19, particularly
focusing on chest X-ray images (El-Rashidy, 2020)
(Ozturk, 2020). High levels of accuracy, surpassing
97%, were achieved using various machine learning
models, with one study notably demonstrating
consistent training and testing accuracy, which speaks
to the model's robustness.
In conclusion, these studies set robust benchmarks
and provide a solid foundation in healthcare
applications involving machine learning. The current
study aims to contribute to this body of work by
introducing a technique for optimizing class weights
in imbalanced datasets to improve machine learning
model performance.
3 METHODOLOGY
The work completed can be divided into four
sections: Dataset Gathering, Pre-processing Dataset,
Building and Training model, and Evaluating Results.
3.1 Data Gathering
The VGG16 model is trained using a publicly
available ECG image database (Khan, 2021). This
database was created by collecting 12-lead ECG
images using the "EDAN SERIES-3" ECG device,
with a sampling rate of 500 Hz. The device was
installed in the Cardiac Care and Isolation units of
various healthcare institutes across Pakistan. Initially,
the database contained the following numbers of
images: 250 for COVID-19 patients, 859 for normal
individuals, 77 for myocardial infarction patients, 203
for patients with a previous history of myocardial
infarction, and 548 for patients with abnormal
heartbeats. For the purpose of three-class multiclass
classification, images belonging to the abnormal,
COVID-19, and normal categories were selected.
To create a balanced dataset, a total of 750 images
were used, with each category containing 250 images.
For an imbalanced dataset, 1470 images were
utilized: 380 images from patients with abnormal
heartbeats, 250 from COVID-19 patients, and 840
from normal individuals.
3.2 Pre-Processing Dataset
The methods used for processing the images are
important for the machine to learn the necessary
features to classify the images accurately. The images
are processed in MATLAB using the following three
steps including gamma correction (Fig. 1B),
grayscaling (Fig. 1C), and cropping (Fig. 1D). For
this specific problem, color is not an essential feature,
hence the images are grayscaled. Grayscaling will
reduce the computational power required and
increase training speed simplifying the learning
process. It also consumes less space which should be
taken into consideration when dealing with large
datasets. Gamma correction however helps in the
brightness and contrast adjustments, The gamma
value used is 0.6. The gamma is set < 1 to get the
desired effect that is the image is brightened and
darker regions are enhanced, decreasing sensitivity in
difference of lighting and making relevant patterns
easier to learn for the model.