Close Menu
    Trending
    • How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins
    • Become a Better Data Scientist with These Prompt Engineering Tips and Tricks
    • Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025
    • Transform Complexity into Opportunity with Digital Engineering
    • OpenAI Is Fighting Back Against Meta Poaching AI Talent
    • Lessons Learned After 6.5 Years Of Machine Learning
    • Handling Big Git Repos in AI Development | by Rajarshi Karmakar | Jul, 2025
    • National Lab’s Machine Learning Project to Advance Seismic Monitoring Across Energy Industries
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»Leveraging Data to Predict Myocardial Infarction: A Machine Learning Approach | by Raonak Shukla | Jan, 2025
    Machine Learning

    Leveraging Data to Predict Myocardial Infarction: A Machine Learning Approach | by Raonak Shukla | Jan, 2025

    Team_AIBS NewsBy Team_AIBS NewsJanuary 14, 2025No Comments8 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    In 2021, Michael, a 62-year-old man from america, skilled a sudden and extreme coronary heart assault whereas he was working at house. On the time, he wasn’t feeling effectively however didn’t understand how critical the state of affairs was. His Apple Watch, nevertheless, repeatedly monitored his coronary heart fee and detected that it was abnormally excessive and irregular, triggering an alert.

    The watch’s notification recommended he ought to search quick medical consideration, urging him to name emergency providers. Because of the immediate motion enabled by the watch’s alert, Michael known as for assist, and paramedics arrived at his house shortly thereafter. He was instantly taken to the hospital, the place docs confirmed that he had suffered a coronary heart assault however that fast intervention had doubtless saved his life.

    Myocardial infarction accounts for 9 million deaths yearly, and most coronary heart illness deaths might be prevented if correct predictions have been made earlier. This text will attempt to clarify the workings of machine-learning fashions behind such live-saving prediction. It would talk about varied pre-processing and have engineering methods to extract the utmost info from ECG alerts. The ECG dataset used within the research consists of wholesome people (y = 0) and people with two pathologies: myocardial infarction (y = 1) and cardiomyopathy (y = 2). The predictor variable, x, is a 30000 × 1 vector representing the ECG time sequence for every particular person.

    An ECG waveform consists of a number of key elements, every representing a particular electrical occasion within the coronary heart:

    P-wave: That is the primary wave within the ECG, and it represents the depolarization (activation) of the atria (higher chambers of the center). When the atria contract, blood is pushed into the ventricles (decrease chambers).

    Fig 1: ECG Sign of a wholesome individual

    QRS Advanced: That is the sharp, spiky a part of the ECG and represents the depolarization of the ventricles. It’s essentially the most distinguished function of the ECG, because it displays the principle pumping motion of the center.

    T-wave: This wave represents the repolarization (restoration) of the ventricles, when the center cells reset in preparation for the subsequent contraction. It’s often a rounded, upward deflection.

    Myocardial Infarction (MI), or coronary heart assault, is a extreme coronary heart situation attributable to a major discount or blockage of blood circulation to the center muscle, ensuing within the loss of life of cardiac cells. The ECG can reveal patterns of ST-segment elevation or melancholy, that are indicative of a coronary heart assault. Irregular Q waves can be an indication of a previous coronary heart assault.

    Fig 2: ECG of an individual having coronary heart assault
    • Excessive-dimensional options: ECG knowledge has a really excessive dimension, requiring in depth processing.
    • Nonlinear and non-stationary alerts: ECG alerts are random, weak, and affected by exterior elements like respiration and physique actions.
    • Noise sources: Baseline drift attributable to respiration and physique actions, impacting frequencies under 0.5 Hz. The ST section, essential for diagnosing myocardial infarction, shares frequencies with baseline drift, making filtering difficult.
    • Characteristic extraction: Correct extraction from the PQRST advanced is important for classification success.

    Time-domain plots of wholesome people’ ECG alerts exhibit typical rhythms and waveforms with out vital abnormalities. Beneath is a illustration of the primary 10,000 knowledge factors.

    Fig 3: ECG of a wholesome affected person

    ECG alerts of people with myocardial infarction might present elevation or melancholy of the ST section and irregular Q waves. Beneath is the ECG of a myocardial infarction affected person pattern showcasing the primary 10,000 knowledge factors.

    Fig 4: ECG of a affected person with myocardial infarction

    The next preprocessing methodologies are adopted to organize knowledge for additional evaluation:

    • Eradicating Linear and Non-Linear Drift: ECG sign drift was addressed utilizing the “detrend” perform in R, initially making use of linear regression, but it surely did not deal with non-linear tendencies. The next-order polynomial improved outcomes, although not utterly, resulting from erratic tendencies. Lastly, Penalized B-spline regression with trial-and-error parameters was used for higher becoming.
    Fig 5: Becoming a spline to detrend ECG alerts
    • Outlier Remedy: A big spike in ECG alerts disrupted the height detection algorithm. A modified Inter Quartile Vary (IQR) technique was used to detect outliers, defining Higher and Decrease Bounds (UB, LB) based mostly on the 99th and 1st percentiles. Outliers have been changed with the sign’s median, bettering peak detection.
    Fig 6: Interquartile vary for removing of outlier
    • Re-scaling and Discovering R-wave Peaks: ECG alerts are re-scaled between 0 to 1 for comparability. The “findpeaks” perform from the “gsignal” bundle is used to detect R-wave peaks, with parameters set to keep away from detecting noise or T-wave peaks. Nonetheless, in some circumstances, T-waves could also be greater than R-waves, resulting in faulty detection and incorrect heartbeat intervals, that are discarded in subsequent steps.
    Fig 7: Peak detection in ECG Sign
    • Smoothing the ECG sign: The uncooked ECG sign is closely affected by noise, which complicates subsequent duties. To deal with this, a B-spline regression is utilized to suit a non-linear curve, yielding wonderful outcomes, as demonstrated within the determine.
    Fig 8: Penalized Spline line in Crimson on a heartbeat
    • Finding P-Q-R-S-T indexes in ECG: The B-spline match simply offers the first and the 2nd by-product which is helpful to find the P, Q, S, and T factors. For the S and Q factors, a easy heuristic is used since they’re the native minima simply after and earlier than the R-wave respectively. The P-wave is usually an upright native maxima, whereas the T-wave will be upright (native maxima) or inverted (native minima), with T-wave inversion probably indicating cardiac points. Spinoff assessments are used to establish these native extrema: the primary by-product needs to be near zero, and the second by-product needs to be non-zero, constructive for inverted waves and adverse for upright ones.
    Fig 9: PQRST, baseline and ST elevation

    The placement of vital factors within the ECG — P, Q, R, S and T are used to calculate 24 options. Some essential options are defined under:

    • Wave Amplitudes Options: The peak of the R-wave and T-wave relative to the baseline can point out cardiac illness. The amplitude is calculated for all 5 factors, specifically P,Q,R,S, and T.
    • Length Options: Literature exhibits varied durations between key factors can assist establish the situation. Calculate the R-duration, QT interval, and PQ interval.
    • Peak Distinction Options: The ratio of R to S wave peak (R/S ratio) can be utilized as a diagnostic function. The peak distinction between the next pairs of factors — Q & S, S & T, R & T can be calculated.
    • ST Elevation: Probably the most well-liked options to establish myocardial infarction is the presence of elevated ST section. The ST-segment begins on the offset level of the S-wave and onset level of the T-wave.

    ST_Elevation = median([S_wave_offset:T_wave_onset]) − heartbeat_baseline

    • Form Options: The form of the waves can result in figuring out the cardiac situation. For instance, a ”dagger-like” Q-wave is a function of Hypertrophic Cardiomyopathy. The second by-product on the peak factors P, Q, S, and T is saved as a function.

    To make sure strong and generalizable outcomes, 4-fold cross-validation with 4 repetitions was employed. The Random Forest mannequin emerged because the best-performing mannequin, reaching a 73% accuracy on the validation set, adopted by Naive Bayes and LDA. Characteristic significance evaluation by means of permutation demonstrated that essentially the most vital function was the T-wave amplitude, aligning with literature findings. A adverse T-wave amplitude indicated a possible cardiac situation, whereas massive constructive amplitudes pointed to abnormalities. Seven out of the highest eight options have been associated to the T-wave, with ST-elevation additionally recognized as an essential predictor for myocardial infarction. Though LDA had the third-best efficiency, it was helpful for visualizing class separation, with sufferers divided into three lessons based mostly on linear discriminant elements. Initially, fashions like KNN and SVM carried out poorly resulting from unscaled options, however after re-scaling, KNN matched Random Forest with a 73% cross-validated accuracy on the validation set, displaying the significance of function scaling for distance-based fashions.

    Fig 10: Cross-validated Mannequin Accuracy on Validation Information

    The present ECG problem mannequin has limitations, together with incorrect measurements from the heuristic used for finding PQRST factors and points with noisy heartbeat cycles. The algorithm struggles when T-waves are bigger than R-waves, and the imbalanced coaching dataset reduces accuracy for sure lessons. Future enhancements may contain including extra factors (e.g., J level), dealing with T-wave and R-wave variations, making use of constraints on peak width, utilizing LDA scores for non-linear fashions, and addressing pattern imbalance.

    As AI continues to evolve, the combination of machine studying in healthcare won’t solely enhance diagnostic accuracy but in addition pave the best way for customized medication.

    Code: https://github.com/raonakshukla/ECG/blob/main/ECG_Myocardial_Cardiomyopathy.R

    Full report: https://github.com/raonakshukla/ECG/blob/main/ECG.pdf



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleUnlocking the Potential of Generative AI for Marketing Success
    Next Article Mastering the Poisson Distribution: Intuition and Foundations | by Alejandro Alvarez Pérez | Jan, 2025
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025

    July 1, 2025
    Machine Learning

    Handling Big Git Repos in AI Development | by Rajarshi Karmakar | Jul, 2025

    July 1, 2025
    Machine Learning

    A Technical Overview of the Attention Mechanism in Deep Learning | by Silva.f.francis | Jun, 2025

    June 30, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    Building Linear Regression from Scratch: Forecasting YouTube Ad Revenue | by Hari Patel | Mar, 2025

    March 8, 2025

    How Bias and Variance Affect Your Model | by Gustavo R Santos | Dec, 2024

    December 24, 2024

    Training vs. Testing vs. Validation: Understanding Model Evaluation | by Leo Mercanti | May, 2025

    May 1, 2025
    Our Picks

    How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins

    July 1, 2025

    Become a Better Data Scientist with These Prompt Engineering Tips and Tricks

    July 1, 2025

    Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.