Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class EKG Aritmia Wavelet Deep Learning Classification #5: 1D CNN and 2D CNN on Scalogram”.
Other ways we can help with Python.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Multi-Objective Optimization Course: NSGA-II, MOPSO & Hybrid Algorithms (Python)

ECG Arrhythmia Classification Course with Wavelet & Deep Learning (PyTorch)

ANFIS + PSO/GA Course for Non-Linear Time Series Forecasting (Python)
Have it built for you
No time to learn Python? Our team can do the project for you.

Python Machine Learning — Prediction Models, Customer Segmentation, Fraud Detection & AI Apps

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Here is the final result, two convolutional networks, one reading the bitstream directly and one reading the scalogram image, trained in seconds on the GPU. The results are surprising, on new patients, both do not automatically outperform SVM. Let's get started. Hello, welcome to episode five of the EKG classification series with Wavelet and Deep Learning. CNN can learn features on its own without human design. CNN 1D reads directly from the signal shape, and CNN 2D reads from the scalogram like recognizing an image. Today we are training both and testing them honestly.
Create the model_underscore_cnn.py file. CNN 1D has three one-dimensional convolutional blocks with Batch normalization and Max Pooling. Then the features are combined with four RR features before the classification layer. CNN 2D is similar but uses two-dimensional convolution for the 32x64 scalogram image. Combining RR is important because the rhythm is not visible from a single bit alone.
The training function takes B with probability proportional to the square root of one over class frequency. Rare classes are seen more often, but not over-learned. Augmentation randomly shifts amplitude, adds noise, and shifts bits by several samples, mimicking variation between patients. Weight decay adds regularization. The prediction function runs the model in large chunks on the GPU.
Create the train_underscore_cnn.py file. RR features are standardized using DS1 statistics. CNN 1D is trained for 4 epochs on the entire DS1, and CNN 2D is trained on 10,000 bits plus all arrhythmia bits because scalograms consume memory. Both are tested on the entire DS2 and their predictions are saved. Run Each finishes in dozens of seconds on the GPU. CNN 1D achieves an accuracy of about 90% with a sensitivity V of about 90%, but sensitivity S and F are low. CNN 2D achieves an accuracy of about 85%. The exact numbers may vary slightly with each GPU training session.
Proceed to the Confusion Matrix. Let's take a look at the graph. Both CNNs perform well in recognizing the distinctive V bits, but many S and F bits fall into the N class. The S bits are almost identical in shape to the normal ones, with the main difference being in timing. CNNs tend to memorize the shape of trained patient bits, so their superiority over human-designed features does not automatically emerge in new patients.
Done. We have designed both 1D and 2D CNNs for scalograms, trained them with balanced sampling and augmentation, and tested them across patients. In the final episode, we compared all models per class and observed which bit segments the CNNs focused on. Are you working on a thesis, dissertation, or research in the field of biomedical engineering and artificial intelligence? Cerdas Inovasi Digital helps with the implementation of biomedical signal processing, from EKG filtering and segmentation, wavelength transformation, classical machine learning, up to 1D and 2D CNNs along with their interpretation, as well as opening Python programming courses for electrical and biomedical engineering. Want to master the entire series, from the MITBIH baseline data to class-wise arrhythmia evaluation? All 6 episodes, complete with step-by-step PDF guides, datasets, and source code, are available to premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy a single class with lifetime access. Subscribe now at the premium page cerdasinovasidigital.com Contact us via WhatsApp, or visit cerdasinovasidigital.com Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →