<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Keepingupwithriya on Medium]]></title>
        <description><![CDATA[Stories by Keepingupwithriya on Medium]]></description>
        <link>https://medium.com/@keepingupwithriya?source=rss-97b4c5442e47------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AaXn_VVlVBiTKg83wfbUSg@2x.jpeg</url>
            <title>Stories by Keepingupwithriya on Medium</title>
            <link>https://medium.com/@keepingupwithriya?source=rss-97b4c5442e47------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:19:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@keepingupwithriya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Rethinking AI Readiness in Sierra Leone]]></title>
            <link>https://medium.com/@keepingupwithriya/rethinking-ai-readiness-in-sierra-leone-cd089e8aa966?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd089e8aa966</guid>
            <category><![CDATA[sierra-leone]]></category>
            <category><![CDATA[ai-in-africa]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 10:01:24 GMT</pubDate>
            <atom:updated>2026-11-30T10:01:24.747Z</atom:updated>
            <content:encoded><![CDATA[<p>In 2024, approximately 82% of Sierra Leone’s population had 4G coverage, yet only 25% used the internet.</p><p>I came across these figures while reading the World Bank’s <a href="https://www.worldbank.org/en/country/sierraleone/publication/sierra-leone-ai-readiness-diagnostic">Sierra Leone AI Readiness Diagnostic</a>. They made me reconsider some of my assumptions about AI development in Sierra Leone.</p><p>I had also recently read <a href="https://www.nature.com/articles/s43588-026-01084-9">An alternative path for artificial intelligence in Africa</a>, published in <em>Nature Computational Science</em>, in which the authors propose distributed sovereignty as an alternative to individual African countries investing heavily in national AI infrastructure.</p><p>Personally, I do not see our reliance on foreign computing infrastructure as necessarily problematic at this stage. Given our electricity and connectivity challenges, I am not entirely convinced that investing heavily in national AI infrastructure would be sustainable or even economically justified.</p><p>What concerns me more is the extent of that reliance. If an institution builds its operations around an external AI service and that service suddenly becomes unavailable in Sierra Leone, how easily can the institution recover? The same applies to changes in pricing, data policies and licensing agreements. These considerations become particularly important when the technology supports essential public services.</p><p>Beyond infrastructure, there is the question of our institutional readiness to adopt AI. From my experience within the education system, some basic administrative processes remain manual. Meanwhile, discussions about AI in education often revolve around whether students should be allowed to use it for assignments. I understand the concerns about academic integrity, but I would also like to see institutions exploring how these tools could be incorporated into teaching and learning.</p><p>The World Bank diagnostic discusses Small AI, an approach centred on affordable, context-appropriate applications. Interestingly, some examples of this approach in Sierra Leone are emerging through WhatsApp.</p><p>A study titled <a href="https://thedocs.worldbank.org/en/doc/92b16c3efb81bc2dd0446c318ea56d9c-0050022025/original/Could-AI-Leafrog-the-Web-Evidence-from-Teachers-in-Sierra-Leone.pdf">&#39;Could AI Leapfrog the Web?&#39; examined evidence from teachers in Sierra Leone</a> on how teachers used an AI chatbot for teaching support. The researchers found that accessing AI-generated responses could be considerably cheaper in terms of mobile data consumption than loading conventional web pages.</p><p>Beyond education, <a href="https://www.premiermedia-sl.com/open-hubb-launches-flot-business-whatsapp-ai-chat-to-transform-digital-payments/">Flot Business</a> introduced conversational financial transactions through WhatsApp, while <a href="https://www.dsti.gov.sl/news/edsa-whatsapp-chatbot-official-launch">DSTI</a>, in collaboration with EDSA and the Ministry of Energy, introduced a WhatsApp chatbot for reporting electricity faults.</p><p>What I appreciate about these initiatives is that they build around existing user behaviour. People do not necessarily have to download another application or learn an entirely new interface to access a service.</p><p>There are, however, applications where dependence on internet-based platforms may be less desirable.</p><p>Following my undergraduate dissertation on cardiac arrhythmia classification using machine learning, I have been working on implementing the classification pipeline on an ESP32-P4 microcontroller. The objective is to explore offline ECG processing and classification, particularly for healthcare settings with unreliable connectivity.</p><p>One of the interesting aspects of this work has been reconsidering model selection from a deployment perspective. A model that performs well on a computer may present entirely different challenges when implemented on a resource-constrained device. Memory consumption, processing time and computational complexity become important considerations alongside predictive performance.</p><p>Although the project is still under development and would require further clinical validation, it has influenced how I think about AI research in Sierra Leone.</p><p>Before reading the World Bank diagnostic, I was inclined to believe that Sierra Leone needed to address its digitalisation challenges before seriously pursuing AI. I now think there are opportunities to pursue both simultaneously, provided we understand the problems we are trying to solve.</p><p>I would like to see more AI research in Sierra Leone informed by the conditions under which these technologies will eventually operate. This could involve investigating how models perform on inexpensive hardware, how much connectivity an application actually requires, or how locally collected data affects predictive performance.</p><p>I do not think Sierra Leone needs to achieve technological self-sufficiency before it can benefit from AI. However, I do think we need to develop enough technical capacity to make informed decisions about the technologies we adopt and retain the ability to replace them when necessary.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd089e8aa966" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Before Classifying a Heartbeat, How Do We Find It?]]></title>
            <link>https://medium.com/@keepingupwithriya/before-classifying-a-heartbeat-how-do-we-find-it-a5a9451ce1ec?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5a9451ce1ec</guid>
            <category><![CDATA[biomedical-engineering]]></category>
            <category><![CDATA[signal-processing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[electrocardiography]]></category>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 01:44:49 GMT</pubDate>
            <atom:updated>2026-10-12T01:44:49.148Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Exploring R-peak detection, the mathematics behind Pan–Tompkins, and what happens before an ECG classifier makes a prediction.</em></p><p>Imagine looking at an electrocardiogram (ECG) recording. To the untrained eye, it might look like a collection of repeating spikes. Some are tall, others are small, and sometimes the signal wanders unpredictably. Now imagine building a machine learning system to distinguish normal from abnormal heartbeats. We might begin by thinking about preprocessing, feature extraction, or choosing a classification algorithm. But there is a question that comes before all of that: <strong>How does the computer know where each heartbeat occurs? </strong>It sounds simple until we try to answer it.</p><h3>The Question I Didn’t Fully Explore in My Dissertation</h3><p>During my undergraduate dissertation on ECG arrhythmia classification, I worked with recordings that already contained reference annotations identifying heartbeat locations. This allowed me to focus on classification, but it also meant the classifier was given something a practical ECG monitoring system would need to determine for itself. I wanted to explore automatic detection during my dissertation, but time constraints meant prioritising the classification experiments.</p><p>Recently, I returned to that question. I implemented and evaluated a Python R-peak detector based on the Pan–Tompkins approach and investigated how automatic detection fits into the classification pipeline. What interested me was not simply whether a peak could be detected, but how mathematical operations could distinguish cardiac activity from other changes in a continuous signal.</p><h3>Why Can’t We Just Find the Tallest Spikes?</h3><p>An ECG records electrical activity associated with the heart. A typical waveform contains the P wave, QRS complex, and T wave. The QRS complex is particularly useful for heartbeat detection because it often contains rapid changes in voltage. Its R peak is typically a prominent positive deflection. Locating successive R peaks allows us to calculate the time between heartbeats:</p><p>RR = t₂ − t₁</p><p>And estimate instantaneous heart rate:</p><p>HR = 60 / RR</p><p>For example, an RR interval of 0.8 seconds corresponds to 75 beats per minute. But real ECG signals are not always clean. Baseline wander, muscle interference, electrode movement, and variations in heartbeat morphology can complicate detection. A prominent T wave might be mistaken for a heartbeat, while a smaller QRS complex might be missed. A fixed amplitude threshold creates a dilemma: set it too high and genuine beats are missed; set it too low and noise is accepted. Instead of asking which point has the highest voltage, we need to ask:</p><p><strong>Which part of the signal has the characteristics of a QRS complex?</strong></p><h3>The Mathematics Behind Pan–Tompkins</h3><p>In 1985, Jiapu Pan and Willis Tompkins developed a real-time QRS detection algorithm that combined several signal-processing operations.</p><p>Its basic sequence is:</p><p>ECG → Filtering → Differentiation → Squaring → Integration → Adaptive detection</p><p>Each stage highlights something useful about QRS activity.</p><h3>1. Filtering: Keeping the Useful Frequencies</h3><p>ECG recordings contain slow variations such as baseline wander and higher-frequency interference. A bandpass filter suppresses some unwanted components while retaining frequency content useful for QRS detection. The original Pan–Tompkins method used a detection passband of approximately 5 to 15 Hz.</p><p>A discrete linear filter can be expressed as:</p><p>y[n] = Σ h[k]x[n−k]</p><p>The output y[n] is formed by combining input samples x[n] using filter coefficients h[k]. The filter does not recognise a heartbeat. It makes certain signal characteristics easier to examine.</p><h3>2. Differentiation: Finding Rapid Changes</h3><p>QRS complexes often contain steep slopes. Differentiation measures how quickly a signal changes. A simple discrete approximation is:</p><p>d[n] = x[n] − x[n−1]</p><p>If consecutive samples are similar, the difference is small. If the signal changes rapidly, the difference becomes larger. The original Pan–Tompkins algorithm uses a five-point derivative filter, but the underlying idea is the same. We are interested not just in how high a wave is, but how quickly it rises or falls.</p><h3>3. Squaring: Making Strong Changes Stand Out</h3><p>The derivative can be positive or negative. Squaring removes the sign and emphasises larger responses:</p><p>s[n] = d[n]²</p><p>For example, ²² = 4, while ⁵² = 25.</p><p>A relatively small increase in derivative magnitude produces a much larger squared response. However, sharp noise can also produce large values, so squaring alone cannot identify a heartbeat.</p><h3>4. Moving-Window Integration: Looking Beyond One Sample</h3><p>A QRS complex occupies a short interval rather than a single instant. Moving-window integration considers activity across neighbouring samples:</p><p>w[n] = (1/N) Σ s[n−k], k = 0,...,N−1</p><p>Here, N is the number of samples in the window.</p><p>The original algorithm used a 150 ms integration window at a sampling frequency of 200 Hz. A short window may respond strongly to brief disturbances, while a long window may blur nearby waveform components. Even the choice of window length becomes an engineering decision.</p><h3>5. Adaptive Thresholds: Learning From Recent Activity</h3><p>After these transformations, the algorithm still needs to decide which candidates are genuine QRS complexes. Rather than relying on one fixed threshold, Pan–Tompkins maintains running estimates of signal peaks and noise peaks.</p><p>One threshold equation is:</p><p>THRESHOLD₁ = NPKI + 0.25(SPKI − NPKI)</p><p>Here, SPKI estimates QRS-related peak strength and NPKI estimates noise-peak strength in the integrated signal. As those estimates change, the threshold changes too. The algorithm also uses timing information. Its search-back mechanism can reconsider weaker candidates when an expected heartbeat appears to be missing, while refractory and slope-based rules help prevent false detections. What I find fascinating is how the algorithm combines frequency content, slopes, activity over time, and previous detections to make a decision.</p><h3>Detecting a QRS Complex Is Not the Same as Finding Its R Peak</h3><p>This is an important distinction. Pan–Tompkins identifies QRS activity, but the peak in its processed signal does not necessarily correspond to the exact R-peak location in the original ECG. Filtering and integration introduce delays and alter the waveform. Depending on the implementation, additional processing is needed to localise the R peak.</p><p>Why does this matter for machine learning?</p><p>Consider an ECG sampled at 360 Hz. If a detector places an R peak 10 samples away from its actual location, the timing difference is:</p><p>Timing error = (10 / 360) × 1000 ≈ 27.8 ms</p><p>That might sound small, but a classifier extracting a fixed-length window around the detected peak now receives a shifted segment. Features describing the heartbeat’s shape may change. <strong>An error in heartbeat detection can affect the information a classifier receives. </strong>This is also why evaluating a detector on its own is different from evaluating an entire ECG classification pipeline.</p><h3>From Python to a Practical System</h3><p>Pan–Tompkins remains interesting decades after its introduction because its operations are understandable and relatively efficient. That makes it a useful starting point for real-time and resource-constrained systems. But implementing a detector in Python and running it continuously on embedded hardware are different challenges. How much signal history must be stored? How should processing delays be handled? Can the same behaviour be preserved when moving to C++ and hardware with limited resources? These are questions I am continuing to explore as I work towards a portable implementation.</p><h3>The Question I’m Taking Forward</h3><p>When I began my ECG research, I focused on how machine learning models could distinguish heartbeat patterns and generalise to patients not seen during training. Returning to R-peak detection made me think more carefully about what happens before the classifier receives its input. What I appreciate about Pan–Tompkins is how familiar mathematical ideas become useful when combined thoughtfully. Derivatives, squares, moving averages, and adaptive thresholds are individually simple, but together they provide a practical approach to detecting cardiac events.</p><p>It also raises a broader question I want to keep investigating: how do we build physiological-signal systems that remain reliable when signals become noisy, patients differ, and computational resources are limited? Because building a useful ECG system is not only about recognising abnormal patterns. It is about understanding how reliably we can move from a raw electrical signal to a meaningful prediction. <strong>And before we can classify a heartbeat, we first have to find it.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5a9451ce1ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One model does not fit three domains]]></title>
            <link>https://medium.com/@keepingupwithriya/one-model-does-not-fit-three-domains-47df748e7d32?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/47df748e7d32</guid>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[vertical-ai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 12:31:01 GMT</pubDate>
            <atom:updated>2026-08-16T12:31:01.330Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a moment that keeps coming up when you try to build something useful with a language model. You have a working general assistant. It sounds fluent. Then you point it at a real domain and watch it get things quietly, confidently wrong. Not wrong in grammar. Wrong in a way only someone inside that domain would catch.</p><p>I ran into this while thinking about Kuma, our local-language project, and where it would actually get used. The original plan was never one assistant for everything. It was assistants for the places people need help: agriculture, mobile money, health, education. At the time we were not thinking in terms of deep specialization. We were mostly focused on getting a capable model to work well in the language. The deeper I went, the clearer it became that these are not three flavors of the same product. They are three different worlds, and a single model treats them as one at its peril.</p><p>In a recent meeting someone raised the question of verticals specifically in the context of fine-tuning for intent. That conversation stayed with me because it pointed at the right problem, but it stopped at the surface. Fine-tuning for intent is necessary. It is not sufficient. The reason a single model fails across domains runs deeper than missing intents.</p><h3>The easy answer, and why it is not enough</h3><p>Ask why you need to specialize a model per domain and the first answer you will hear is vocabulary. Every field has its own words. Agriculture has terms for crops, pests, seasons, and soil that a general model has barely seen. Fintech has its own language of transfers, balances, agents, and float. Health has symptoms, conditions, and dosages. The model does not know these words well, so it fumbles them.</p><p>This is true, and it is the part everyone notices first. But if you stop here you will build the wrong thing. Vocabulary is the surface. If the only problem were unfamiliar words, you could fix it with a glossary and move on. The real problem sits underneath, and it is about meaning rather than words.</p><h3>The same word is a different request in each domain</h3><p>The thing that changed how I saw this was realizing that the same phrase can mean completely different things depending on which domain the user is standing in.</p><p>Take a word as simple as “transfer.” In fintech, transfer is money moving from one account to another. The user wants to send funds, check a failed transaction, or understand a fee. In health, a transfer is a patient being moved to another facility, and the person asking is worried about a referral. In agriculture, you might transfer seedlings from a nursery to a field. Same word. Three unrelated intents. Three completely different right answers.</p><p>Now scale that up. It is not one ambiguous word. It is the entire space of what people are trying to do. What a user means, what counts as a helpful reply, and what a dangerous mistake looks like are all defined by the domain. A model that does not know which world the user is in cannot reliably tell what they are asking, no matter how many domain words you teach it. The nomenclature is not the same, but more importantly the intents behind the nomenclature are not the same.</p><p>That is what a vertical really is. Not a topic, and not a word list. A vertical is a whole space of things people are trying to do, with its own map of what those requests mean and what a good answer looks like. Fine-tuning for intent helps the model recognize patterns inside that space. It does not automatically give the model the correct map of the space itself.</p><h3>Why the stakes differ too, not just the meanings</h3><p>There is a second reason the domains cannot share one model, and it is easy to miss until it bites you. The cost of being wrong is wildly different across verticals.</p><p>If an agriculture assistant gives a slightly imperfect planting tip, the user loses a little time. If a fintech assistant misreads a request and implies money moved when it did not, you have a trust problem and possibly a financial one. If a health assistant confidently answers a question it should have refused and told someone to seek care, the cost is measured in a way no product should ever gamble with.</p><p>A single general model applies the same confident tone everywhere. These domains do not deserve the same confidence. Each vertical needs its own sense of when to answer, when to hedge, and when to stop and hand off to a human. That judgment cannot be shared, because it is not the same judgment.</p><p>Specialization is not only about understanding the user better. It is about calibrating how the assistant behaves to what that domain can afford. A model that has been fine-tuned for intent still needs an explicit sense of risk and refusal boundaries that match the domain. Without that, the same fluent style becomes a liability in one vertical while remaining acceptable in another.</p><h3>Once you add voice, the domain decides what the sound means</h3><p>There is a further layer that only appears when the system works with speech rather than text, and it matters because Kuma is built on speech. When a person talks, the words carry one channel of information and the voice carries another. How someone sounds, their pace, their strain, their breathing, the weakness or steadiness in the delivery is signal. And how much that signal matters is itself a property of the domain.</p><p>In health this is not a detail. It is often the point. A caregiver describing a patient, or a patient speaking for themselves, can sound unwell in ways the words alone do not capture. A voice that is faint, breathless, or clearly in distress tells you something a transcript would flatten into neutral text. A speech system serving a health vertical that hears only the words and discards how they were said is throwing away part of the diagnosis. At the same time, this is exactly where overreach is dangerous. Reading too much into a tired-sounding voice is its own kind of error, and the domain is what decides how far you are allowed to lean on that signal.</p><p>Now put the same capability in fintech or agriculture. Whether a person sounds tired while asking about a failed transfer or a planting schedule is mostly irrelevant to what they need. The words carry the request, and the voice is close to noise. The acoustic channel that is precious in one vertical is discardable in another. So even at the level of raw sound, before any question of meaning, the domain determines what counts as information and what counts as noise. That is one more thing a single general model cannot get right everywhere at once.</p><h3>What specializing actually means in practice</h3><p>The tempting conclusion is that you should train three separate models. For a project like Kuma that is usually the wrong move. Training a full model per domain is expensive. It multiplies everything you have to maintain. For low-resource languages you rarely have enough data to do it three times over. The goal is a model that behaves like a specialist, not necessarily three models built from scratch.</p><p>In practice that means keeping a shared foundation and adapting it per vertical. You start from one capable base model that already handles the language. Then you specialize lightly. You fine-tune on domain examples so it learns each vertical’s intents and tone. You route each user to the right vertical so the model knows which world it is in before it interprets a single word. You lean on retrieval so the domain’s actual facts, prices, procedures, and referral rules live in a source you can update rather than baked into weights you cannot change easily.</p><p>The specialization is real, but it is layered on top of a shared core rather than paid for three times. “Specialize per vertical” is a statement about behavior, not about how many models you train. You want the agriculture assistant and the fintech assistant to think differently. Whether that is separate fine-tunes, separate adapters, or clever routing over one model is an engineering choice you make based on your data and your budget. For most teams the lighter option is the right one.</p><p>The meeting conversation about fine-tuning for intent was useful because it named the need for domain-specific behavior. The fuller picture is that intent recognition is only one layer. You also need the model to inhabit the correct space of meanings, the correct tolerance for error, and in a speech system the correct sense of what the voice itself is telling you. None of those come for free from a general model, even after light fine-tuning.</p><h3>The takeaway</h3><p>The instinct to build one model that does everything is strong, because that is what a general assistant looks like and it is what the demos show. But the moment you serve real users in real domains, the seams appear. A vertical is not a subject the model needs more words for. It is a distinct space of intentions, with its own meanings for shared words, its own tolerance for being wrong, and its own sense of what a voice is saying beneath the words.</p><p>Building for it means deciding which world the user is in first, then interpreting everything through that world. For Kuma that is the difference between an assistant that sounds fluent in Krio and one that is actually useful to a farmer, a mobile money agent, and a clinic, each of whom said the same word and meant something entirely their own.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47df748e7d32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linear transformations: what a matrix is actually doing]]></title>
            <link>https://medium.com/@keepingupwithriya/linear-transformations-what-a-matrix-is-actually-doing-e2c8e28ff67b?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c8e28ff67b</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 22:36:41 GMT</pubDate>
            <atom:updated>2026-07-11T22:36:41.658Z</atom:updated>
            <content:encoded><![CDATA[<p>Most people meet matrices as a computational rule. Row times column, sum the products, produce a new array. The mechanics are learnable in an afternoon and the interpretation is quietly skipped. But the interpretation is the entire point, and without it a matrix stays an opaque grid instead of what it really is: a complete description of a linear transformation.</p><p>This post rebuilds that interpretation from the ground up.</p><h3>Vectors as coordinates in a basis</h3><p>Take the vector (3, 2). The two numbers are not arbitrary labels. They are coordinates, and coordinates only mean something relative to a chosen set of reference vectors called a basis.</p><p>In the standard basis, those references are the unit vectors along each axis. Call them i and j. The vector (3, 2) is shorthand for a linear combination:</p><p>(3, 2) = 3i + 2j</p><p>Every vector in the space is expressible this way, as a weighted sum of the basis vectors. The coordinates are just the weights. This is the definition worth internalizing early, because a linear transformation is defined entirely by what it does to this combination.</p><h3>What makes a transformation linear</h3><p>A transformation T maps every vector in the space to another vector. It is linear when it satisfies two properties:</p><ul><li>It preserves vector addition: T(u + v) = T(u) + T(v)</li><li>It preserves scalar multiplication: T(cv) = cT(v)</li></ul><p>These two conditions have a powerful consequence. Apply T to (3, 2):</p><p>T(3i + 2j) = 3·T(i) + 2·T(j)</p><p>The transformation of the whole vector is fully determined by the transformation of i and j alone. You do not need to know what T does to infinitely many points. You only need to know where it sends the basis vectors, and linearity handles the rest.</p><p>This is the structural fact that makes linear algebra tractable. An entire transformation of the plane collapses to two pieces of information.</p><h3>The matrix is the image of the basis</h3><p>Suppose T sends i to (2, 1) and sends j to (-1, 1). Record those two output vectors as the columns of a matrix:</p><pre>| 2  -1 |<br>| 1   1 |</pre><p>The first column is T(i). The second column is T(j). That is the definition of the matrix associated with T, not a convention layered on top of it. A matrix is the transformation’s action on the basis, written down. Reading a matrix column by column tells you exactly how the space is being reshaped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8OTMT-X3DkA93mLPk1CVg.png" /></figure><h3>Matrix-vector multiplication, derived rather than memorized</h3><p>Now compute where (3, 2) is sent, using linearity directly:</p><p>T(3i + 2j) = 3·T(i) + 2·T(j) = 3·(2, 1) + 2·(-1, 1) = (6, 3) + (-2, 2) = (4, 5)</p><p>Notice what happened. The result was obtained by scaling each column of the matrix by the corresponding coordinate of the input vector, then summing. That procedure, scale the columns and add, is matrix-vector multiplication. The familiar row-times-column rule computes the identical result; it is simply a reindexed version of the same operation.</p><p>So the mechanical rule was never the real object. It is a bookkeeping method for evaluating a linear combination of the transformed basis vectors. The columns-scaled-and-summed view is worth carrying forward, because it generalizes cleanly and it keeps the geometry visible.</p><h3>Composition and why matrix multiplication is defined the way it is</h3><p>The reason matrix multiplication has its particular, initially strange definition also falls out of this view. Applying transformation A and then transformation B to a vector means computing B(A(v)). The matrix representing the combined transformation is the product BA, and the rule for multiplying two matrices is exactly what is required to make the columns of the product equal the images of the basis under the composed map.</p><p>Matrix multiplication is not an arbitrary rule. It is the arithmetic of composing transformations. Once the single-vector case is clear, the two-matrix case is the same idea applied one column at a time.</p><h3>Where this leads</h3><p>This reframing pays off well beyond the two-dimensional example. The determinant becomes the factor by which the transformation scales area or volume, and its sign records whether orientation is preserved. The column space is the span of the transformed basis vectors, which is precisely the set of reachable outputs. Eigenvectors are the directions the transformation leaves pointing the same way, scaling them without rotating them. Every one of these concepts is a direct reading of the same underlying object: a matrix as a linear transformation acting on a basis.</p><p>The computational rules are worth knowing. But they sit on top of a single geometric idea. A matrix records where the basis vectors go, linearity extends that to every other vector, and multiplication is nothing more than following that combination through. Hold that idea steadily and the rest of linear algebra reads as consequences rather than rules to memorize.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c8e28ff67b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Butterworth Bandpass Filter From Scratch- Math, Code, and All]]></title>
            <link>https://medium.com/@keepingupwithriya/building-a-butterworth-bandpass-filter-from-scratch-math-code-and-all-7f16a5030100?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f16a5030100</guid>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 11:45:52 GMT</pubDate>
            <atom:updated>2026-04-02T11:45:52.141Z</atom:updated>
            <content:encoded><![CDATA[<p><em>No shortcuts. Just pure understanding.</em></p><p>Before starting my dissertation I was challenged to build a filter completely from first principles no shortcuts, no library functions. The challenge came from a friend who knows DSP to the bone. He set me this task and I took it as his way of accepting to be one of my unpaid supervisors. (He has not denied it yet)</p><p>The task: design a Butterworth bandpass filter completely from scratch. S domain, Z domain, recurrence relation, Python implementation, the whole thing. I went in thinking this was going to be painful. The bilinear transform especially I had seen that term floating around and it sounded intimidating. But after sitting down and actually doing the math step by step? It is genuinely simple. Like, very simple.</p><p>So let me walk you through exactly what I did.</p><h3>What Are We Building?</h3><p>A <strong>bandpass filter</strong> that:</p><ul><li><strong>Keeps</strong> frequencies between 0.5 Hz and 40 Hz</li><li><strong>Removes</strong> everything below 0.5 Hz (baseline drift)</li><li><strong>Removes</strong> everything above 40 Hz (high frequency noise)</li></ul><p>Think of it like a window:</p><pre>BLOCKED  |     KEPT      | BLOCKED<br>  0 Hz  0.5 Hz          40 Hz   ∞</pre><p>Why these frequencies? This specific filter is for cleaning ECG heart signals the useful cardiac information lives between 0.5 and 40 Hz. Everything outside is just noise.</p><h3>Step 1: S Domain Design</h3><p>The S domain (Laplace domain) is basically a mathematical world where filter design is easier. Instead of working with time directly, you describe your filter as a fraction output over input.</p><p>First we convert our cutoff frequencies from Hz to radians per second using <strong>w = 2π × f</strong></p><pre>w1 = 2π × 0.5  = 3.142 rad/s<br>w2 = 2π × 40   = 251.327 rad/s</pre><p>Then we calculate three key values:</p><p><strong>Bandwidth: </strong>how wide is our frequency window?</p><pre>BW = w2 - w1 = 251.327 - 3.142 = 248.185</pre><p><strong>Center frequency squared: </strong>the middle of our window</p><pre>w0² = w1 × w2 = 3.142 × 251.327 = 789.6</pre><p>Now we write the transfer function H(s):</p><pre>H(s) = (BW × s) / (s² + BW×s + w0²)</pre><p>Substituting our numbers:</p><pre>H(s) = 248.185s / (s² + 248.185s + 789.6)</pre><p>That is our analog filter.</p><h3>Step 2: Converting to Digital (The Bilinear Transform)</h3><p>Computers work with discrete samples not continuous signals. So we need to convert our analog filter into something digital. This is where the bilinear transform comes in.</p><p>The formula is literally just a substitution. Everywhere you see <strong>s</strong>, you replace it with:</p><pre>s = (2/T) × (z-1)/(z+1)</pre><p>Where T is the sampling period. With a sampling frequency of 90 Hz:</p><pre>T = 1/90 = 0.0111 seconds<br>2/T = 180.18</pre><p>So s becomes:</p><pre>s = 180.18 × (z-1)/(z+1)</pre><p>Now substitute into H(s) and multiply everything by (z+1)² to clear the fractions. After expanding:</p><p><strong>Numerator:</strong></p><pre>44717.97 × (z² - 1) = 44717.97z² - 44717.97</pre><p><strong>Denominator</strong> (three terms expanded and added together):</p><pre>Term 1: 32464.8z²  - 64929.6z  + 32464.8<br>Term 2: 44717.97z² + 0z        - 44717.97<br>Term 3: 789.6z²    + 1579.2z   + 789.6</pre><pre>Total:<br>z²:       77972.37<br>z:       -63350.4<br>constant: -11463.57</pre><p>Divide everything by 77972.37 to normalize:</p><pre>H(z) = (0.5735z² - 0.5735) / (z² - 0.8125z - 0.1470)</pre><p>That is our digital filter.</p><h3>Step 3: Recurrence Relation</h3><p>Now we convert H(z) into something that runs sample by sample. We write H(z) = Y(z)/X(z), cross multiply, then use the Z domain rule that z⁻¹ means “one sample back in time.”</p><p>After rearranging to make y[n] the subject:</p><pre>y[n] = 0.5735×x[n] - 0.5735×x[n-2] + 0.8125×y[n-1] + 0.1470×y[n-2]</pre><p>In plain English, to calculate the current output you need:</p><p>Term What it means 0.5735 × x[n] Current input sample -0.5735 × x[n-2] Input from 2 samples ago 0.8125 × y[n-1] Output from 1 sample ago 0.1470 × y[n-2] Output from 2 samples ago</p><p>That equation IS the filter. Everything else is just implementing it.</p><h3>Step 4: Python Implementation</h3><pre>import numpy as np<br>import matplotlib.pyplot as plt<br>from numpy.fft import fft, fftfreq</pre><pre># Filter parameters<br>fs = 90<br>f_low = 0.5<br>f_high = 40</pre><pre># Convert to radians<br>w1 = 2 * np.pi * f_low<br>w2 = 2 * np.pi * f_high</pre><pre># Calculate filter parameters<br>BW = w2 - w1<br>w0_sq = w1 * w2</pre><pre># Bilinear transform<br>T = 1 / fs<br>k = 2 / T</pre><pre># H(z) coefficients<br>num = BW * k<br>d_z2 = k**2 + BW*k + w0_sq<br>d_z1 = -2*k**2 + 2*w0_sq<br>d_z0 = k**2 - BW*k + w0_sq</pre><pre># Normalize<br>b0 =  num / d_z2<br>b2 = -num / d_z2<br>a1 = -d_z1 / d_z2<br>a2 = -d_z0 / d_z2</pre><p><strong>The filter function: literally just the recurrence relation in code:</strong></p><pre>def butterworth_filter(x):<br>    N = len(x)<br>    y = np.zeros(N)</pre><pre>    for n in range(N):<br>        x_n  = x[n]<br>        x_n2 = x[n-2] if n &gt;= 2 else 0<br>        y_n1 = y[n-1] if n &gt;= 1 else 0<br>        y_n2 = y[n-2] if n &gt;= 2 else 0</pre><pre>        y[n] = b0*x_n + b2*x_n2 + a1*y_n1 + a2*y_n2</pre><pre>    return y</pre><h3>Step 5: Testing It</h3><p>To test the filter honestly, I created a signal with 5 frequencies, 3 inside the filter range (should be kept) and 2 outside (should be reduced):</p><pre>t = np.arange(0, 1, 1/fs)</pre><pre># INSIDE filter range 0.5-40 Hz - KEEP these<br>sig_5  = np.sin(2 * np.pi * 5  * t)<br>sig_15 = np.sin(2 * np.pi * 15 * t)<br>sig_30 = np.sin(2 * np.pi * 30 * t)</pre><pre># OUTSIDE filter range - REMOVE these<br>sig_35 = np.sin(2 * np.pi * 35 * t)<br>sig_42 = np.sin(2 * np.pi * 42 * t)</pre><pre>x = sig_5 + sig_15 + sig_30 + sig_35 + sig_42<br>y = butterworth_filter(x)</pre><p><strong>One important note on the test frequencies:</strong></p><p>You might wonder why I used 35 and 42 Hz instead of something more dramatic like 50 or 60 Hz. The reason is the <strong>Nyquist limit</strong>. With a sampling frequency of 90 Hz, the maximum frequency you can represent is 45 Hz (half the sampling rate). Any frequency above 45 Hz simply cannot exist in this signal. So to actually see the filter removing components in the spectrum plot, all test frequencies must be below 45 Hz. This is an important DSP concept worth understanding your sampling rate determines what frequencies are even visible to you.</p><p><strong>Here is what the signal looks like before and after filtering:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2NKFU0vMHGiY0Tg_imehg.png" /><figcaption>The original signal is chaotic and messy with amplitude reaching ±4. After filtering it is noticeably cleaner and smoother, amplitude reduced to around ±2 as the 35 and 42 Hz components are removed.</figcaption></figure><p><strong>And here is the frequency spectrum that proves it:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*19zS8O8Vk-4z89-jM4FPXQ.png" /><figcaption>Looking at the spectrum you can see exactly what the filter did:</figcaption></figure><p>Frequency Result 5 Hz Kept blue and red peaks same height 15 Hz Kept blue and red peaks same height 30 Hz Mostly kept slight reduction near the 40 Hz cutoff edge 35 Hz Significantly reduced outside filter range 42 Hz Strongly reduced close to Nyquist limit</p><p>This is exactly what a bandpass filter should do.</p><h3>What I Took Away From This</h3><p>Doing this from scratch rather than just calling scipy.signal.butter() and moving on changed how I understand filtering completely.</p><p>When you derive everything by hand first the S domain math, the bilinear substitution, the Z domain algebra the code becomes obvious. You are not copying a function you found online. You are translating math you already understand into Python.</p><p>The bilinear transform specifically before this I had seen it mentioned in textbooks and papers and it always looked like something complicated. It is not. It is one substitution. Replace s with a fraction involving z, expand the brackets, collect terms. That is it.</p><p>If you are a student dealing with DSP for the first time do the math by hand at least once before touching code. It is worth it.</p><blockquote><em>Full code: </em><a href="https://github.com/Iyeba-Kallon/-butterworth_filter.git"><em>https://github.com/Iyeba-Kallon/-butterworth_filter.git</em></a></blockquote><p><em>This filter was built as preparation for an ECG arrhythmia classification system targeting rural health clinics in Sierra Leone.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f16a5030100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Spent Way Too Long Making a Python Audio Equalizer and Learned a Lot]]></title>
            <link>https://medium.com/@keepingupwithriya/i-spent-way-too-long-making-a-python-audio-equalizer-and-learned-a-lot-6a2e8ff35d08?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a2e8ff35d08</guid>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 15:55:35 GMT</pubDate>
            <atom:updated>2026-03-13T15:55:35.511Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>I Spent Way Too Long Making a Python Audio Equalizer and Learned a Lot</strong></p><p>A few weeks ago I had one of those Saturday afternoon rabbit holes where you start by “just tweaking something small” and emerge six hours later having rewritten half a project.</p><p>The thing I was tweaking: a Python audio equalizer and spectrum analyzer I’d built a while back. It worked. It ran. But every time I opened it I felt mildly embarrassed, the way you feel about old code, like finding a journal from high school.</p><p>So I overhauled it. Here’s what actually happened.</p><p><strong>The FFT was lying to me</strong></p><p>The spectrum analyzer’s core job is to take a chunk of audio and show you what frequencies are in it, measured in decibels. My original version was doing this wrong in a way that’s easy to miss: it was feeding raw int16 values into the FFT without normalizing them first.</p><p>The result? The noise floor was completely fictional. Numbers that should read around -60 dBFS were nowhere close. To fix it, I divided the windowed audio data by chunk_size × 32768 (the max value of int16), which gives you actual dBFS, the same scale professional audio tools use. Now silence actually looks like silence, and a full-scale signal actually hits 0 dB. That felt goooodddd.</p><p><strong>Seeing the EQ curve in real-time</strong></p><p>Once the spectrum was honest, I wanted to see what the equalizer was <em>doing</em> to the signal — not just the signal itself. So I added an overlay: a dotted orange line showing the combined frequency response of all ten EQ bands, recalculated live as you drag the sliders.</p><p>This uses scipy.signal.sosfreqz under the hood. The moment I got it working and dragged a slider and watched the curve bend in real-time over the live spectrum, I felt unreasonably pleased with myself. Worth the detour.</p><p><strong>Threading nearly broke my brain</strong></p><p>Here’s the part nobody warns you about with real-time audio: you have two completely separate processes running simultaneously. One thread is capturing audio at 44,100 samples per second. Another thread is trying to draw the spectrum 30 times per second. They’re both touching the same buffer.</p><p>Without any coordination, you get crashes. Or worse silent data corruption that only shows up sometimes, in a way that’s nearly impossible to reproduce. The fix is a threading.Lock: a single line that says &quot;only one of you touches this memory at a time.&quot; Simple in hindsight, infuriating to diagnose.</p><p><strong>Making it not look terrible</strong></p><p>The default Tkinter aesthetic is… not great. It looks like a Windows 98 dialog box that escaped. I rebuilt the whole interface with a dark theme, custom slider styling, and a 10-band EQ layout (31Hz through 16kHz) instead of the original 6-band setup.</p><p>A few additions that made a real difference:</p><ul><li><strong>Peak hold</strong>: a red decay line that tracks the highest recent transient. Actually useful for monitoring, not just decorative.</li><li><strong>Live dB labels</strong>: each slider shows its current value as you drag it. Obvious in retrospect, but the original didn’t have this.</li><li><strong>Status indicator</strong>: just a colored dot that says RUNNING or STOPPED. Tiny thing. Makes the whole app feel more alive.</li></ul><p><strong>Presets, because nobody wants to EQ from scratch every time</strong></p><p>I added a preset system Bass Boost, V-Shape, that kind of thing. This was mostly for usability, but it also forced me to think about the EQ values in a more principled way. What actually makes a “bass boost” sound right vs. just boosting 60Hz until it’s obnoxious? Spent more time than I expected on this.</p><p><strong>What I actually took away from this</strong></p><p>Python isn’t the obvious choice for low-latency audio work, but PyAudio, NumPy, and SciPy are genuinely capable if you&#39;re careful about where your time is going. The math part FFT, IIR filters, frequency response is almost the easy part once you understand it. The hard parts were the threading bug, the normalization mistake, and honestly just making the UI feel responsive enough that it didn&#39;t get in the way.</p><p>The gap between “it works” and “I’d actually use this” turned out to be almost entirely UX. Which is probably a lesson that applies to more than just audio tools.</p><p>Code is on GitHub if you want to poke at it: <a href="https://github.com/Iyeba-Kallon/realtime-audio-equalizer-spectrum-analyzer">github.com/Iyeba-Kallon/realtime-audio-equalizer-spectrum-analyzer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a2e8ff35d08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper #4: Finally, Someone Gets It — Lightweight Classical ML For The Win]]></title>
            <link>https://medium.com/@keepingupwithriya/paper-4-finally-someone-gets-it-lightweight-classical-ml-for-the-win-b6c14334033c?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c14334033c</guid>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 22:58:25 GMT</pubDate>
            <atom:updated>2026-01-23T22:58:25.596Z</atom:updated>
            <content:encoded><![CDATA[<h3>Paper #4: Finally, Someone Gets It — Lightweight Classical ML For The Win</h3><p><em>Week 1, final paper. This one’s from 2025 (literally brand new preprint) and honestly? This is EXACTLY the approach I’m taking. Like, this person read my mind.</em></p><h3>The Paper</h3><p><strong>“A Lightweight, CPU-Deployable, and Interpretable ECG Arrhythmia Classification Pipeline”</strong></p><p><strong>Author:</strong> Weihao Cheng (2025, preprint on SSRN)</p><p>Found this specifically because I was looking for recent work on lightweight/deployable ECG classification. The title alone told me this was what I needed.</p><h3>Why This Paper Hits Different</h3><p>Most ECG papers: “Look at our 99.9% accuracy with this massive deep learning model that needs a GPU cluster!”</p><p>This paper: “Here’s 86% accuracy with Random Forest running on your laptop CPU. And you can actually EXPLAIN why it made each decision.”</p><p><strong>For rural clinic deployment? The second one is WAY more useful.</strong></p><h3>What They Did</h3><p><strong>Dataset:</strong> MIT-BIH (same one I’m using)</p><p><strong>Classification:</strong> 5-class (Normal, Supraventricular, Ventricular, Fusion, Paced) AAMI standard</p><p><strong>Features (super simple):</strong></p><p><strong>Time-domain:</strong></p><ul><li>Mean, standard deviation, min/max</li><li>Peak-to-peak amplitude</li><li>RMS (root mean square)</li><li>Mean absolute value</li></ul><p><strong>Frequency-domain:</strong></p><ul><li>FFT energy in 5 bands</li><li>Total signal energy</li></ul><p><strong>That’s it. Like 12–15 features total.</strong></p><p><strong>Models tested:</strong> Logistic Regression, Random Forest, SVM</p><p><strong>Results:</strong></p><ul><li>Random Forest: <strong>86.4% accuracy</strong> (best overall)</li><li>Logistic Regression: <strong>42.4% accuracy</strong> but best balanced performance</li><li>SVM: <strong>60.4% accuracy</strong></li></ul><h3>The Important Part: Record-Wise Split</h3><p>They did something smart that a lot of papers DON’T do:</p><p><strong>Record-wise split</strong> beats from the same patient don’t end up in both training AND testing sets.</p><p><strong>Why this matters:</strong> Heartbeats from the same person are similar. If you train on beats 1–100 from Patient A and test on beats 101–200 from Patient A, you’re basically cheating. The model memorized that person’s rhythm.</p><p><strong>Record-wise split:</strong> Train on Patients 1–24, test on completely different Patients 25–48. Way more realistic.</p><p><strong>Result:</strong> Lower accuracy (86% vs the 99% you see in other papers) but HONEST. This is how it would actually perform on new patients.</p><h3>What I’m Taking From This</h3><p><strong>1. Classical ML is still viable in 2025</strong></p><p>No GPUs. No deep learning. Just Random Forest and good features. 86% accuracy.</p><p>For a rural clinic trying to flag “this person might need further evaluation,” that’s actually really useful.</p><p><strong>2. Interpretability &gt; peak accuracy</strong></p><p>The paper explicitly argues: doctors/nurses need to understand WHY the system flagged something. Logistic Regression coefficients show feature importance. Deep learning is a black box.</p><p><strong>3. The features I’m planning are validated</strong></p><p>I was planning RR intervals, QRS characteristics, amplitude stats. This paper uses similar stuff and it WORKS.</p><p><strong>4. They acknowledge what’s missing</strong></p><p>Paper openly says “we didn’t include RR interval features and that hurt our N vs S distinction.”</p><p>THAT’S EXACTLY WHAT I’M ADDING. So my approach should improve on this.</p><p><strong>5. CPU-only is a feature, not a limitation</strong></p><p>Most papers treat “runs on CPU” as an afterthought. This paper centers it. For deployment in places without reliable power/computing? That’s critical.</p><h3>Limitations They Acknowledge</h3><p><strong>Class imbalance:</strong> Normal beats way outnumber abnormal ones. Hurts minority class performance.</p><p><strong>Missing temporal features:</strong> No RR intervals. Probably why N vs S classification struggled.</p><p><strong>Preprint status:</strong> Not peer-reviewed yet (submitted to SSRN, not a journal)</p><p>But honestly? These limitations are GOOD for me. They’re basically laying out exactly what I should improve on.</p><h3>How This Changes My Approach</h3><p><strong>Before reading this:</strong></p><ul><li>Felt uncertain about using classical ML (everyone’s doing deep learning)</li><li>Worried 85–90% accuracy wouldn’t be “good enough”</li><li>Not sure if my feature plan was solid</li></ul><p><strong>After reading this:</strong></p><ul><li>Classical ML is CURRENT and VALID (2025 paper proves it)</li><li>86% is realistic and honest (record-wise split)</li><li>My features (adding RR intervals to their approach) should actually IMPROVE on this baseline</li></ul><p><strong>What I’m doing differently:</strong></p><ul><li>Adding RR interval features (current, previous, variability)</li><li>Maybe trying KNN alongside RF/LR</li><li>Same record-wise validation approach</li><li>Same focus on interpretability and deployment</li></ul><h3>Real Talk</h3><p>This paper feels like someone looked at all the flashy deep learning ECG papers and said “okay but what if we need this to actually WORK in the real world?”</p><p>And that’s exactly my dissertation’s angle. Not maximum accuracy. Not state-of-the-art algorithms. Just: robust, explainable, deployable system for places without endless computing resources.</p><p>Reading this paper was honestly reassuring. My approach isn’t outdated or too simple. It’s <strong>intentional</strong>. And someone just published (2025) basically validating that approach.</p><p>Also the fact that they explicitly note RR intervals as a missing piece? And that’s literally what I’m planning to add? Feels like I’m on the right track.</p><p>One more thing: the author made all the code reproducible. If I get stuck implementing, there’s literally a reference implementation I can check.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c14334033c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper #3: The Simplest Approach Is All You Need]]></title>
            <link>https://medium.com/@keepingupwithriya/paper-3-sometimes-the-simplest-approach-is-all-you-need-e6ab0b498043?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6ab0b498043</guid>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 22:54:41 GMT</pubDate>
            <atom:updated>2026-04-22T07:46:50.093Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Week 1, Paper 3/4. This one’s from 2012 and honestly? It’s basically a tutorial. But that’s exactly why I needed to read it.</em></p><h3>The Paper</h3><p><strong>“Filtering Of Ecg Signal Using Butterworth Filter And Its Feature Extraction”</strong></p><p><strong>Authors:</strong> Bharti Salsekar and Dr. A.K. Wadhwani (2012)</p><p>Found this because it’s literally a step-by-step MATLAB guide for ECG preprocessing. Sometimes you need the basics spelled out before diving into fancy algorithms.</p><h3>What They Did</h3><p>Super straightforward:</p><ul><li>Took 2 ECG signals (1 normal person, 1 from MIT-BIH with arrhythmia)</li><li>Applied Butterworth low-pass filter to remove noise</li><li>Extracted 4 features: P wave amplitude, R wave amplitude, T wave amplitude, RR interval</li><li>Compared to normal clinical values</li><li>Said “yep, this one’s abnormal”</li></ul><p>That’s it. No machine learning. No fancy ensembles. Just: filter → measure → compare to textbook values.</p><h3>The Features</h3><p>This is actually the most useful part — they list <strong>normal ECG values</strong>:</p><p><strong>Amplitudes:</strong></p><ul><li>P wave: 0.25 mV</li><li>R wave: 1.60 mV</li><li>T wave: 0.1–0.5 mV</li></ul><p><strong>Intervals:</strong></p><ul><li>PR interval: 0.12–0.20 sec</li><li>QRS duration: 0.09 sec</li><li>Normal heart rate: 60–100 BPM</li></ul><p><strong>Their results:</strong></p><p><strong>Normal subject:</strong> Everything in range (R ~1.73 mV, P ~0.21 mV, RR ~0.58 sec)</p><p><strong>Abnormal subject:</strong> Multiple red flags (R ~2.15 mV -HIGH, P ~0.40 mV -HIGH, RR ~0.45 sec SHORT/fast heart rate)</p><p>Conclusion: abnormal. Possibly hypokalemia or arrhythmia.</p><h3>What I’m Taking From This</h3><p><strong>1. Clinical reference values are gold</strong></p><p>Having these normal ranges means I can use them as features or thresholds. “Deviation from normal R amplitude” could literally be a feature in my classifier.</p><p><strong>2. Simple features work for basic classification</strong></p><p>They didn’t need 60+ features. Just 4 amplitude/timing measurements caught the abnormality.</p><p><strong>3. Butterworth filtering is standard</strong></p><p>They only used LOW-PASS (remove high-frequency noise), but other papers use BANDPASS (remove both baseline drift AND noise). Bandpass seems better.</p><p><strong>4. This is educational, not cutting-edge</strong></p><p>2012 paper. 2 subjects. No actual machine learning. It’s basically a MATLAB tutorial.</p><p>But that’s fine sometimes you need the fundamentals before the fancy stuff.</p><h3>Limitations</h3><p>Pretty obvious ones:</p><ul><li>Only 2 subjects (not exactly rigorous research)</li><li>Only low-pass filter (no baseline wander correction)</li><li>Manual comparison (no automated classifier)</li><li>Published in 2012 (12+ years old)</li></ul><p>This wouldn’t fly as a main reference, but for understanding the BASICS of ECG processing? Actually useful.</p><h3>How This Fits My Project</h3><p><strong>Taking:</strong></p><ul><li>Normal ECG value ranges (for feature engineering)</li><li>Validation that amplitude features work</li><li>MATLAB filter implementation reference (butter() function)</li></ul><p><strong>Not taking:</strong></p><ul><li>Only low-pass approach (I’m using bandpass like Papers 1 &amp; 2)</li><li>Manual comparison method (I’m using SVM/RF/KNN)</li><li>The tiny sample size</li></ul><p><strong>Why it matters:</strong> Sometimes you need a simple baseline to understand what you’re building on. This paper strips ECG classification down to absolute basics and shows that even basics can distinguish normal from abnormal.</p><p>Also those clinical reference values are going straight into my feature engineering notes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6ab0b498043" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sometimes Simple Really Is Better: A Surprising ECG Research Finding]]></title>
            <link>https://medium.com/@keepingupwithriya/sometimes-simple-really-is-better-a-surprising-ecg-research-finding-2e7b401651f3?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e7b401651f3</guid>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Thu, 22 Jan 2026 09:21:44 GMT</pubDate>
            <atom:updated>2026-01-22T09:21:44.845Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Week 1 of my dissertation journey continues, and I just finished reading a paper that basically said “everyone’s been doing this wrong.” Honestly? They might have a point.</em></p><p>I’m currently diving deep into ECG-based heartbeat classification research, and the second paper on my reading list turned out to be a game-changer. It’s called “ECG-based machine-learning algorithms for heartbeat classification,” published in Scientific Reports in 2021. I picked it up because it kept appearing in every search about ECG classification, and being newer than my first paper (2021 vs 2019), I figured I should see what changed in those two years.</p><p>Spoiler alert: a lot changed. And what I learned challenged everything I thought I knew about feature engineering.</p><h3>The Problem With Most ECG Research</h3><p>Here’s something that might surprise you: most ECG classification research gets tested on a dataset called MIT-BIH that contains recordings from just 48 patients. That’s it. Forty-eight people.</p><p>Researchers routinely achieve 99% accuracy on this dataset and publish papers proclaiming their algorithm’s brilliance. But when you try those same algorithms on actual real-world patient data? They completely fall apart.</p><p>This paper calls out that problem directly. The authors argue that researchers have been overfitting to a tiny dataset, and their fancy, complex methods don’t actually work in practice. To prove their point, they tested on a massive dataset containing over 10,000 patients from Shaoxing People’s Hospital in China a far more realistic scenario.</p><p>The results were shocking. Those complex methods using 36+ features? Their accuracy dropped from 99% to 37%. Meanwhile, the authors’ simpler method maintained 90.7% accuracy across both datasets.</p><p>That’s more than just interesting it’s a fundamental insight about how we should approach machine learning problems.</p><h3>What They Actually Did</h3><p>The researchers tackled four main challenges: peak detection, signal preprocessing, feature extraction, and classification. Let me walk through each one.</p><p><strong>Peak Detection</strong></p><p>Unlike my first paper (which used pre-marked heartbeat positions), these researchers implemented their own peak detection algorithm to identify three critical components:</p><ul><li>R-peaks: the prominent spike in every heartbeat (relatively easy to find)</li><li>P waves: the small bump before the R-peak (much harder)</li><li>T waves: the bump after the R-peak (also tricky)</li></ul><p>Why detect all three? Because the timing between these peaks reveals crucial information about cardiac health. They used Fractional Fourier Transform combined with Two-Event Related Moving Averages admittedly, the technical details went over my head a bit. But what matters is that it worked better than existing methods, especially for those notoriously difficult P and T waves.</p><p>For my own project, I’m probably sticking with simpler, established algorithms like Pan-Tompkins. No need to reinvent the wheel when proven methods exist.</p><p><strong>Preprocessing</strong></p><p>They used Discrete Wavelet Transform with a Daubechies-4 wavelet for filtering, which differs from my first paper’s approach using Butterworth filters. Wavelets supposedly handle non-stationary signals better (which ECGs definitely are), but they’re also more complex to implement. I’m leaning toward Butterworth filters for simplicity sometimes good enough really is good enough.</p><p><strong>Feature Extraction: Where It Gets Interesting</strong></p><p>This is where they dropped the bomb that changed my entire perspective.</p><p>Most papers extract dozens of features: 36+ measurements from various transformations, autoregressive model coefficients, wavelet coefficients, and all kinds of complex mathematical representations. The more features, the better, right?</p><p>Wrong.</p><p>These researchers tested just four features:</p><ul><li>PR interval (time from start of P wave to start of QRS)</li><li>RT interval (time from R-peak to end of T wave)</li><li>Age</li><li>Sex</li></ul><p>That’s it. Four numbers per heartbeat. And it worked <em>better</em> than the complex approaches when tested on realistic data.</p><p>Why? Because these features are clinically meaningful. Cardiologists actually use PR and RT intervals to diagnose conditions. They’re not random mathematical transformations they represent real physiological phenomena. As a result, they generalize to new patients instead of simply memorizing patterns in the training data.</p><p>Mind officially blown.</p><p><strong>Classification</strong></p><p>They compared two classifiers: Support Vector Machines (84.2% accuracy) and Multi-Layer Perceptrons (90.7% accuracy). The MLP won, but both significantly outperformed complex methods when the dataset expanded to include more patients.</p><h3>The Results That Actually Matter</h3><p>Let me break down what happened when they compared their approach to existing methods:</p><p><strong>On MIT-BIH (48 patients):</strong></p><ul><li>Complex methods: 99.6–99.8% accuracy</li><li>Their 4-feature method: 80–93% accuracy</li></ul><p>At first glance, you might think, “Wait, that’s worse?” But keep reading.</p><p><strong>On SPH (10,000+ patients):</strong></p><ul><li>Complex methods: 37–38% accuracy</li><li>Their 4-feature method: 90.7% accuracy</li></ul><p>What happened? The complex methods memorized the small dataset but couldn’t handle new patients classic overfitting. The simple method actually learned real patterns that transferred to new data.</p><p><strong>Cross-Database Testing</strong></p><p>Perhaps most impressively, they trained their model on MIT-BIH, then tested it on completely different databases it had never seen. On the INCART database, they achieved 99.85% accuracy. On the SPH database, they hit 68% not amazing, but still functional. This demonstrates that the model truly generalizes rather than simply memorizing one specific dataset.</p><h3>What This Means for My Project</h3><p>Reading this paper fundamentally shifted my approach. Here are my key takeaways:</p><p><strong>Occam’s Razor is real.</strong> Simpler genuinely is better not just because it’s easier to implement, but because it’s more robust. Four meaningful features beat 36+ arbitrary ones when it matters most: on real patients.</p><p><strong>MIT-BIH is tiny.</strong> I’m using MIT-BIH because it’s the standard, but 48 patients isn’t much to work with. I need to be extremely careful about overfitting and can’t just chase high accuracy on the training set. Cross-validation will be crucial.</p><p><strong>Clinical features trump random features.</strong> PR intervals, RT intervals, QRS duration these are measurements cardiologists actually examine. They carry medical meaning, unlike throwing wavelet coefficients at a classifier and hoping it figures something out.</p><p><strong>My feature plan needs updating.</strong> I was initially planning to use 60 raw waveform samples like my first paper. After reading this? I’m switching to meaningful clinical features instead: RR intervals, QRS duration and amplitude, PR and RT intervals (if I can detect P and T waves reliably), and heart rate variability. Maybe 8–10 total features that are interpretable, clinically relevant, and less likely to overfit.</p><p><strong>Peak detection is unavoidable.</strong> I need to actually detect R-peaks at minimum — I can’t take shortcuts. P and T wave detection would give me those valuable PR and RT intervals, but they’re significantly harder to implement. I might start with just R-peaks, get that working, then tackle P and T detection if time allows.</p><h3>Updated Feature List</h3><p>Based on this paper, here’s my revised feature extraction plan:</p><p><strong>Temporal features (4–5):</strong></p><ul><li>Current RR interval</li><li>Previous RR interval</li><li>Average RR over last 10 beats</li><li>RR variability (standard deviation)</li><li>Heart rate (calculated from RR)</li></ul><p><strong>Morphological features (3–4):</strong></p><ul><li>QRS duration (width of the spike)</li><li>QRS amplitude (height of the spike)</li><li>PR interval (if I can detect P waves)</li><li>RT interval (if I can detect T waves)</li></ul><p>Total: 8–9 features. Simple, meaningful, and less likely to overfit.</p><h3>Questions I Still Need to Answer</h3><p><strong>How difficult is P/T wave detection really?</strong> This paper developed an entire algorithm for it, which seems complex. Do I actually need it, or can I get away with just R-peaks and RR intervals? I need to check whether MIT-BIH annotations include P and T wave positions or just R-peaks.</p><p><strong>How do I prevent overfitting with such a small dataset?</strong> They tested on 10,000 patients; I have 48. Cross-validation will help, but that’s still a tiny sample size.</p><p><strong>Should I add an MLP to my comparison?</strong> They found Multi-Layer Perceptrons outperformed SVMs. I’m planning to compare SVM, KNN, and Random Forest. Would adding a simple MLP improve my analysis, or is that scope creep?</p><p><strong>What about demographic features?</strong> They used age and sex data. I’m not sure if MIT-BIH includes these for each heartbeat. I’ll need to investigate.</p><h3>Why This Feels Validating</h3><p>This paper reinforced my decision to use classical machine learning (SVM, Random Forest) instead of deep learning. Everyone’s obsessed with neural networks these days, but this research showed that features matter more than the classifier. A simple MLP with good features beat complex feature engineering, but an SVM with thoughtful features still performed well at 84%.</p><p>More importantly, the paper’s core message aligns perfectly with my project’s rural clinic angle: simpler methods that work in practice beat complex methods that only work in research labs. That’s literally what I’m trying to demonstrate low-complexity, deployable, robust solutions.</p><h3>One Important Caveat</h3><p>I only have MIT-BIH’s 48 patients, while they had 10,000+. This means I need to be extra careful about not overfitting, using proper validation, and being honest about limitations in my dissertation. I can’t claim my method is “proven” when it’s only tested on a tiny dataset. But I can show it’s feasible and theoretically sound.</p><h3>Moving Forward</h3><p>Two papers into my literature review, and I’m feeling increasingly confident about this project. The approach is making more sense, and I’m developing a clearer picture of both the opportunities and the pitfalls.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e7b401651f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Review #1: First ECG Paper Down]]></title>
            <link>https://medium.com/@keepingupwithriya/paper-review-1-first-ecg-paper-down-b5124c509ba0?source=rss-97b4c5442e47------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5124c509ba0</guid>
            <dc:creator><![CDATA[Keepingupwithriya]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 20:13:46 GMT</pubDate>
            <atom:updated>2026-01-17T20:13:46.274Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*eZoKbGZCTtslzMle_BP-Cw.jpeg" /></figure><p><em>Okay so dissertation officially started. Topic: machine learning for ECG analysis in rural clinics. First order of business: actually read some papers and figure out what I’m doing. Here’s how Paper #1 went.</em></p><h3>The Paper</h3><p><strong>“A Fast Machine Learning Model for ECG-Based Heartbeat Classification and Arrhythmia Detection”</strong></p><p><strong>Authors:</strong> Miquel Alfaras, Miguel C. Soriano, and Silvia Ortín</p><p><strong>Published:</strong> 2019, Frontiers in Physics</p><p>Picked this one because “fast” seemed relevant for rural clinic deployment and the title was pretty much exactly what I’m trying to do.</p><h3>The Problem They’re Solving</h3><p>So here’s the deal: ECG machines can record your heartbeat, but actually interpreting what those squiggly lines mean? That needs a cardiologist. And guess what rural health clinics don’t have? Cardiologists.</p><p>This paper is trying to build an automated system that looks at individual heartbeats and goes “yeah this is normal” or “wait, this looks dangerous, get this person to a specialist ASAP.”</p><p>Specifically they’re trying to catch ventricular ectopic beats (VEBs), the kind that can be life-threatening if ignored. Makes sense for places where you can’t just pop down the hall to ask a cardiologist.</p><h3>What They Actually Did (The Parts I Understood)</h3><h3>The Preprocessing Bit</h3><p>ECG signals straight from the machine are apparently a mess. You’ve got baseline drift from breathing, electrical noise, all kinds of interference making it hard to see the actual heartbeat pattern.</p><p>Their solution: <strong>bandpass filter everything to 0.5–35 Hz</strong></p><p>Why those specific numbers? Because:</p><ul><li>Below 0.5 Hz = baseline wander (patient moving, breathing, all that)</li><li>Above 35 Hz = random electrical noise and interference</li><li>0.5–35 Hz = where the actual useful heart information lives</li></ul><p>They used two filters:</p><ul><li><strong>Butterworth high-pass filter</strong> (cuts the low-frequency drift)</li><li><strong>Low-pass FIR filter</strong> (cuts the high-frequency noise)</li></ul><p>Also resampled everything to 250 Hz so all the recordings were on the same scale. Pretty standard stuff apparently.</p><h3>Finding Individual Heartbeats</h3><p>Every heartbeat has this big spike called an R-peak. They just used the pre-marked positions from the database (so they didn’t have to actually detect them themselves, bit of a shortcut but fair enough).</p><p>For my project I’ll have to implement actual R-peak detection. There’s an algorithm called Pan-Tompkins that everyone uses, so… fingers crossed that’s not too painful.</p><h3>Chopping Everything Up</h3><p>They extracted a 240 millisecond window around each heartbeat. So instead of one long continuous ECG recording, you end up with thousands of little heartbeat snippets.</p><p>Then normalized each one to fit between -1 and 1. This way heartbeats from different people are on the same scale and you can actually compare them.</p><h3>The Features</h3><p>This bit was actually pretty simple:</p><p><strong>60 raw waveform samples: </strong>literally just the signal values in that 240ms window. No fancy feature engineering, just the actual data points.</p><p><strong>3 RR interval features:</strong></p><ul><li>ln(current RR interval): time between this beat and the last one</li><li>ln(next RR interval): time until the next beat</li><li>ln(average of last 250 RR intervals): the baseline rhythm</li></ul><p>(They used logarithms because apparently that works better.)</p><p>Why RR intervals? Because abnormal ventricular beats have different timing patterns than normal beats. It’s like a smoking gun if the rhythm’s off, something’s probably wrong.</p><p><strong>Total: 63 features per heartbeat</strong></p><h3>The Classifier (Where It Got Complicated)</h3><p>So here’s where they lost me a bit initially. They used something called <strong>Echo State Networks (ESN)</strong> with a “ring topology.”</p><p>Basically it’s a type of recurrent neural network (meaning it has memory of previous heartbeats, not just looking at each one in isolation). The “ring topology” part means the neurons are connected in a specific simple pattern instead of randomly.</p><p><strong>Why ESN specifically?</strong> (This is what I missed first time)</p><p>After re-reading: they chose it because:</p><ol><li><strong>Memory matters: </strong>heartbeats don’t exist in isolation. The timing pattern (is this beat early? late? normal?) gives context</li><li><strong>Ring topology is simpler</strong> than standard ESNs, easier to optimize, easier to implement in hardware later</li><li><strong>Fast to train, </strong>you don’t optimize the whole network, just the output layer. Makes it way faster than traditional neural networks</li><li><strong>Not prone to overfitting, </strong>they tested this with different network sizes and it stayed stable</li></ol><p>They actually tested this against just looking at individual heartbeats (no memory, η=0 in their parameters) and the memory-based version did way better. So apparently context matters for heartbeat classification.</p><p><strong>The ensemble thing:</strong></p><p>They didn’t just use one ESN. They used <strong>30 of them</strong> and took a majority vote. Why? Because each ESN has some randomness in how it’s set up, and combining multiple reduces errors. Classic ensemble method. (Honestly this feels overkill for my scope but I get why they did it for maximum accuracy.)</p><h3>The Results</h3><p>On MIT-BIH database (Lead II):</p><ul><li><strong>Sensitivity: 92.7%</strong> — caught 92.7% of abnormal beats</li><li><strong>PPV: 86.1%</strong> — when it said abnormal, it was right 86% of the time</li><li><strong>Specificity: 99.7%</strong> — almost never misclassified normal beats</li><li><strong>Overall accuracy: 98.6%</strong></li></ul><p>The ensemble of 30 ESNs did noticeably better than individual ESNs (numbers in parentheses in their table show the average single ESN performance lower across the board).</p><p>Key findings:</p><ul><li>Single-lead ECG worked fine (Lead II for MIT-BIH, Lead A for AHA)</li><li>Same optimal parameters worked across different databases</li><li>Ensemble reduced false negatives significantly (important clinically — better to flag something questionable than miss something dangerous)</li></ul><h3>What I’m Taking From This</h3><p><strong>1. Preprocessing is non-negotiable</strong></p><p>The 0.5–35 Hz bandpass filtering is apparently industry standard. Every ECG paper does this. I’m 100% doing the same thing because why reinvent the wheel?</p><p><strong>2. RR intervals are crucial</strong></p><p>Everyone uses them. They’re simple to calculate (just time between peaks) but super informative. Definitely including these.</p><p><strong>3. Memory/context helps classification</strong></p><p>This is interesting, they showed that looking at sequences of heartbeats works better than treating each beat independently. Makes sense when you think about it (rhythm matters, not just individual beat shape).</p><p>For my project: even though I’m using simpler classifiers (SVM, Random Forest), I should probably include some temporal features. Maybe average RR over last few beats, or heart rate variability measures.</p><p><strong>4. &gt;90% accuracy is totally doable</strong></p><p>My proposal targets &gt;90% sensitivity and specificity. This paper got 92.7% and 99.7% respectively. So I’m not being unrealistic, which is reassuring.</p><p><strong>5. Ensembles improve performance but add complexity</strong></p><p>They used 30 ESNs. I’m using simpler models (SVM, KNN, Random Forest). Random Forest is already kind of an ensemble internally (multiple decision trees), so maybe I’m covering this without extra complexity?</p><h3>What I’m Still Figuring Out</h3><p><strong>ESN vs what I’m doing</strong></p><p>They made a good case for ESN (memory, fast training, not prone to overfitting). But for my undergraduate scope, I think simpler classical ML is still the right call:</p><ul><li>Easier to implement</li><li>More interpretable (can understand why it made a decision)</li><li>Still effective for binary classification</li></ul><p>Plus my supervisor might look at me funny if I show up with reservoir computing in week 3.</p><p><strong>Feature selection</strong></p><p>They used 60 raw waveform samples. I’m thinking of using more meaningful features instead:</p><ul><li>QRS duration (width of the peak)</li><li>QRS amplitude (height)</li><li>Heart rate variability metrics</li><li>Statistical properties</li></ul><p>More interpretable and probably easier to work with for classical ML.</p><p><strong>R-peak detection</strong></p><p>They skipped this step entirely (used pre-annotated positions). I have to actually do it. Slightly nervous but there are established algorithms so should be manageable.</p><h3>How This Applies to My Project</h3><p><strong>Stealing (respectfully):</strong></p><p><strong>Exact preprocessing pipeline</strong></p><ul><li>Butterworth high-pass + low-pass filters</li><li>0.5–35 Hz bandpass</li><li>Heartbeat segmentation around R-peaks</li><li>Normalization to [-1, 1]</li></ul><p><strong>RR interval features</strong></p><ul><li>Current RR</li><li>Maybe average RR over last N beats</li><li>Heart rate variability</li></ul><p><strong>Dataset choice validated</strong></p><ul><li>MIT-BIH is clearly the standard</li><li>Single-lead is sufficient</li><li>Widely used and trusted</li></ul><p><strong>Evaluation metrics</strong></p><ul><li>Sensitivity, specificity, PPV, accuracy</li><li>Industry standard, enables comparison</li></ul><p><strong>Doing differently:</strong></p><p><strong>Simpler classifier</strong></p><ul><li>SVM, KNN, Random Forest</li><li>No ESN (too complex for my scope)</li><li>Should still get good results if features are solid</li></ul><p><strong>More interpretable features</strong></p><ul><li>Clinical features (QRS width/height, HRV)</li><li>Instead of just raw samples</li><li>Easier to explain and defend</li></ul><p><strong>No ensemble</strong> (maybe)</p><ul><li>Random Forest is already ensemble-ish</li><li>Keep it simple for now</li><li>Can always add if results aren’t good enough</li></ul><h3>Honest Assessment</h3><p>First technical paper read. Took longer than expected (had to re-read the ESN section twice). But actually came away understanding the core approach.</p><p>Main takeaway: my project plan is solid. The preprocessing steps are well-established, the target accuracy is realistic, and classical ML should work fine for binary classification.</p><p>Feeling less overwhelmed than when I started. More confident that this is actually doable in 6 months.</p><p>Also realizing that “novel research” at undergrad level doesn’t mean inventing new algorithms. It means applying existing methods thoughtfully to solve a real problem. That’s literally what I’m doing and it’s valid.</p><p>Next step: systematic review paper to see how this fits into the bigger picture. Apparently there are hundreds of ECG classification studies so… lot of reading ahead.</p><p>But heyyyy, 1 down. Progress is progress.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5124c509ba0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>