<?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 Ranga Sampath (youplusai) on Medium]]></title>
        <description><![CDATA[Stories by Ranga Sampath (youplusai) on Medium]]></description>
        <link>https://medium.com/@youplusai?source=rss-c24311bd5101------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*oFgJNSNmUMrZjYV3-Na29A.png</url>
            <title>Stories by Ranga Sampath (youplusai) on Medium</title>
            <link>https://medium.com/@youplusai?source=rss-c24311bd5101------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:43:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@youplusai/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[The hardest thing for a Machine Learning Algorithm (MLA) to say]]></title>
            <link>https://medium.com/data-science/the-hardest-thing-for-a-machine-learning-algorithm-mla-to-say-1f3d935fbc60?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f3d935fbc60</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[novelty]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[machine-learning-models]]></category>
            <category><![CDATA[classification-algorithms]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Mon, 18 Jan 2021 13:20:28 GMT</pubDate>
            <atom:updated>2021-01-18T13:20:28.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*r8jPWJ08cABVkW5-NuxM5A.jpeg" /><figcaption>I don’t know (Photo by <a href="https://unsplash.com/@paul_nic?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Paolo Nicolello</a> on <a href="https://unsplash.com/s/photos/doubt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)</figcaption></figure><p><strong>Abstract:</strong><em> In this article, you will learn why machine learning algorithms find it hard to detect novelty, ponder over how humans are better at this, find out why some common approaches fall short and appreciate the benefits should there be a way to get machine learning algorithms to say — I don’t know.</em></p><h3>A thought experiment</h3><p>Imagine a thought experiment where you are trying to teach a child the various types of fruits like bananas, apples, oranges, watermelons etc. You show a number of pictures of each of the fruits (various sizes and shapes) to the child to ensure that the child becomes familiar. At the end of it, when you now show a fruit to the child, it is able to identify it correctly based on what it has learnt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*4mkAslP96XNLp4DZ.jpeg" /><figcaption>Images of fruits that comprise training data (Photo by <a href="https://unsplash.com/@riosamba?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kamala Saraswathi</a> on <a href="https://unsplash.com/s/photos/apples-oranges?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)</figcaption></figure><p>Let us assume that this child has never seen pictures of a lion or of an elephant and that you now show such a picture to a child and ask it to identify the same. A likely outcome may be that the child is either quiet or says <strong>I don’t know</strong>. Of course, there will be some cases where the child may identify it as one of the fruits that it is recently familiar with but this would be unlikely is what I imagine.</p><h3>The MLA in the hot-seat</h3><p>Do you think the same experiment when done with a Machine Learning Algorithm (MLA) will yield the same result i.e. would the MLA be able to say <strong>I don’t know</strong> or in machine learning parlance, would it be able to classify it as a novel object or as an unknown object?</p><p>In this experiment, the MLA may probably classify the lion as an orange because of the similarity in color and the elephant as a banana because of the similarity in shape of the elephant’s trunk.</p><p>Note that MLAs learn the patterns in the images and associate them with the appropriate image labels.</p><h3>Approaches that may not work</h3><p>Sometimes it is as important to know what will not work as it is to know what will. Here are some approaches that we may think of but they fall short in one way or another.</p><p><em>Training with more data</em> — While the answer to most things in machine learning may be train with more data, this is a case outside of that. No matter how much data you may have, there can always be an image that is out of distribution i.e. out of scope in the training or test data but that is encountered in a real world deployment. The well trained MLA will still not be able to identify the out of distribution object as an unknown.</p><p><em>Introducing more classification classes </em>— Again, just by increasing the classes and making this into a multi-class classification problem does not automatically resolve this issue. Though the classification granularity may get better, it doesn’t address the core issue of identifying an out of distribution object.</p><p><em>Adding negative classes</em> — One approach could be to add a bunch of random objects unrelated to the objective and labeling all those random objects as unknown in the training data. For the experiment we discussed above, add images of different cars, planes, animals, birds, pets, furniture etc. to the training data and label all of these as unknown. The question here is how exhaustive can the negative class be made i.e. how many random objects can be included and the consequent impact on the cost and complexity of the solution.</p><p><em>Confidence scores </em>— MLAs may be associated with a confidence score of their predictions that is expressed as a probability or as a percentage. For example, a new image may be classified as an Orange with a confidence of 92 %. While this seems like a sensible approach, note that the confidence score is based on the degree of similarity that is seen in the new image with the patterns that the MLA has been trained on. A classification model may return a very high score for unknown classes, especially when these classes share common patterns .For example, a lion may be classified as an orange with a confidence score of 78 % because there may be a similarity in the color.</p><h3>What then is a workable approach?</h3><p>Let us work through an example to get some ideas on what can be done.</p><p>Consider the sample representative data below that uses two features — <em>Width</em> (x1 in m) and <em>Length</em> (x2 in m) to label a vehicle as a <strong>Car</strong> or <strong>Not-A-Car</strong> (class labels).</p><p>Parallel lines to the x and y axis drawn to represent the data boundaries split the two dimensional (2-D) space into areas that may be labeled with the appropriate class labels. Note that the test data points shown in another table and plotted on the graph in red are given the label of the areas in which they fall even though they are quite a distance away from the training data points plotted in blue. This is why an MLA will classify any novel data point into a known class rather than call it out as <em>Unknown</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cnyx8J3ZO9YP6S4x.png" /><figcaption>Training and test data plotted on a graph with classification regions (Source: youplusai.com)</figcaption></figure><p>What we need is a mechanism to mark significant enough regions in the 2-D space where training data has not been seen as <em>Unknown</em>. If that were done, the test data points seen in this example would fall into the <em>Unknown</em> region and will therefore be marked as <em>Unknown </em>rather than into the known classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*RRpO49Cx4l0Bhxis.png" /><figcaption>Test data points that are significantly further from training data labeled as Unknown (Source: youplusai.com)</figcaption></figure><p>Note that what is described above is an approach and not a fool-proof solution.</p><p><em>Identifying what you don’t know in machine learning is a hard problem that has not been completely solved yet</em>.</p><p>One of the interesting research papers that I read on this topic thanks to the reference from <a href="https://twitter.com/aaron_j_chavez">Aaron Chavez</a> is titled — <a href="http://ceur-ws.org/Vol-2640/paper_18.pdf"><em>Is Uncertainty Quantification in Deep Learning Sufficient for Out-of-Distribution Detection?</em></a><em> </em>In this paper, the authors compare several state-of-the-art uncertainty quantification methods for deep neural networks regarding their ability to detect novel inputs. In conclusion, they state that the current uncertainty quantification approaches alone are not sufficient for an overall reliable out-of-distribution (data that strongly differs from training data) detection.</p><h3>The benefits</h3><p>In a real-world production deployment of a machine learning based solution, this ability to call out the out-of-distribution data i.e. <em>Novelty</em> as an <em>Unknown</em> class may have several benefits.</p><ul><li>Avoidance — of <em>Novel</em> data misclassification.</li><li>Utility — in domains where it is difficult to obtain fully representative data for training.</li><li>Alerts — could be raised if the percentage of data inputs that got classified as an <em>Unknown</em> class exceeded a set threshold (say 10% of the total inputs classified).</li><li>Retraining — could be triggered if a significant number of data inputs get classified as <em>Unknown.</em></li></ul><p>With an active interest in Data Science, I will be exploring many more topics in this domain. If you’re interested in such endeavors, please join along my journey by following me on <a href="https://twitter.com/@youplusai">Twitter</a> and subscribing to the <a href="https://www.youtube.com/channel/UCQ9-sBJDOS1Ti4lfBSqwP_A">youplusai YouTube channel</a>.</p><p><em>Many thanks to </em><a href="https://www.linkedin.com/in/madhucharis/"><em>Madhusoodhana Chari</em></a><em> for his valuable feedback.</em></p><p><em>Originally published at </em><a href="https://youplusai.com/hardest-thing-mla/"><em>youplusai.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f3d935fbc60" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/the-hardest-thing-for-a-machine-learning-algorithm-mla-to-say-1f3d935fbc60">The hardest thing for a Machine Learning Algorithm (MLA) to say</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cardiovascular Risk — An approach to predict and explain it too]]></title>
            <link>https://medium.com/data-science/cardiovascular-risk-an-approach-to-predict-and-explain-it-too-e6bca678fce9?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6bca678fce9</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[healthcare-ai]]></category>
            <category><![CDATA[clinical-data-science]]></category>
            <category><![CDATA[cardiovascular-disease]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Thu, 10 Dec 2020 04:38:51 GMT</pubDate>
            <atom:updated>2020-12-10T04:38:51.503Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cardiovascular Risk — An approach to predict and explain it too</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4BnFF6StRl9Kd_NnOi6JA.jpeg" /><figcaption>A Machine Learning model may predict cardiovascular risk (Source: Photo by <a href="https://unsplash.com/">Robina Weermeije</a>r on <a href="https://unsplash.com/">Unsplash</a>)</figcaption></figure><p><strong>Abstract:</strong><em> In this article, you will learn what factors may contribute to cardiovascular risk, how they may be factored into a Deep Learning model to predict risk, why it may make little sense in predicting a risk to health without offering any explanation, where does Explainable AI (XAI) step in, what kind of explanations may be given and what do they achieve.</em></p><h3>The Objective</h3><p>Consider a case in Healthcare where a <strong>Machine Learning (ML)</strong> system is asked to predict the risk of a patient developing cardiovascular disease in a given time frame, say within the next one year.</p><p>The output expected from the model is a risk score which if equal to or above a chosen threshold indicates that that patient has a risk of developing cardiovascular disease and if it were below the threshold, indicates no risk.</p><h3>Model considerations</h3><p>The patient data used for this purpose may be composed of various patient attributes like food habits, work habits, exercise routine, past medical conditions, hereditary markers, genetic markers, results of laboratory tests taken periodically etc.</p><p>When the available <em>data is rich and spans many dimensions</em>, typically <strong>Deep Learning (DL)</strong> models are called into play as they perform better and give a greater degree of prediction accuracy.</p><p>Though Deep Learning is most typically used where there is unstructured data i.e. classify images, detect objects, recognize speech, convert speech to text etc., it has found use when dealing with structured data i.e. medical data values, lab test results, physical attributes, signal read outs from devices etc. If you are interested to delve deeper into this aspect, I would highly recommend this <a href="https://medium.com/@markryan_69718/deep-learning-on-structured-data-part-1-7f08584b9883">post</a> by <a href="https://medium.com/@markryan_69718">Mark Ryan</a>.</p><h3>Beyond Model Performance</h3><p>When the predicted results of the Deep Learning model are examined by a clinician, a very pertinent question may be raised — <strong><em>Why did the model take the decision that it did?</em></strong></p><p>i.e. why did the model predict that a given patient, say A is at risk of developing heart disease while another patient, say B is not.</p><p>In this case, explanations similar to any of the following, made available to the clinician may help.</p><p><em>· Patient A has a sedentary lifestyle with minimal physical activity.</em></p><p><em>· Patient A has close family members that have had heart ailments and related conditions.</em></p><p><em>· Patient A has been under medication multiple times in the past 5 years and the lab tests have shown variations in blood composition.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RhkpBKWYrzJzWlX2_M19jA.jpeg" /><figcaption>A black box AI model that is opaque (Source: Photo by <a href="https://unsplash.com/@brandablebox?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Brandable Box</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)</figcaption></figure><p>This is where Deep Learning models encounter a problem i.e. there is no explanation that may be obtained from such a model by the human user. The lack of transparency in the model mechanics is why such models are called <strong>Black Box</strong> models. It would not be amiss to say that such <em>Black Box models would find it hard to get accepted in Healthcare systems</em> because of their opaqueness.</p><h3>Explainable AI (XAI)</h3><p>XAI aims to provide human understandable explanations for how an Artificial Intelligence (AI) system arrived at a decision. Providing explanation for decisions taken fosters trust in the human users of such systems. Trust is essential for such systems to be deployed for a wide range of use cases in domains like Healthcare, Banking, Insurance or even Military.</p><p>One approach is to choose a model like a Decision Tree or Logistic Regression whose outputs are easier to interpret by human users. Of course, the tradeoff may be loss in performance or the lack of generalizability because of the possibility of overfitting to the training data.</p><p>Here, we take an alternate approach of sticking to the Deep Learning model but developing methods to offer better explanations that what a baseline Deep Learning model approach may offer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gtu-ChyGnhL24HZg5mHbdg.jpeg" /><figcaption>XAI explains the reasons behind model predictions (Source: Photo by <a href="https://unsplash.com/@erdaest?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Erda Estremera</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)</figcaption></figure><h3>Building an explainable model</h3><p>The data that represents patients who have been diagnosed with heart disease as well those who haven’t, spans multiple dimensions and therefore could be grouped into buckets that have some semantic meaning. These buckets along with the specific data dimensions that fall into each bucket may be —</p><p><strong>Lifestyle factors </strong>— food habits, work habits, sleep quantity, exercise routines, smoking habits, alcohol intake, stress levels</p><p><strong>Medical factors</strong> — conditions like hypertension or diabetes, results of lab tests, past medical history, known allergies, known sensitivities</p><p><strong>Genealogical factors</strong> — heart ailments within the close family, hereditary factors, genetic markers etc.</p><p>In addition to the baseline DL model that takes all the available patient data across multiple dimensions as input, consider that there are <strong>Component DL models</strong>. A Component DL model is one that is fed patient data pertaining to <em>one semantic bucket</em> only.</p><p>In this use case, there will be three (3) Component DL models, one each catering to <em>Lifestyle factors</em>, <em>Medical factors</em> and <em>Genealogical factors</em>. Now, the results of all the Component DL models are compared for each prediction. The prediction is a score that indicates the risk of developing heart disease. This is typically expressed as a probability between 0 and 1.</p><p><em>Note:</em> All the data dimensions listed above are not necessarily equally important from a data modeling perspective. For example, a smoking habit may be considered more important for determining risk of heart disease than say sleep quantity. The weights attached to signify the importance of each data dimension may be tuned at the time of modeling.</p><p>To illustrate this use case better, consider that a threshold score of 0.6 and above may be taken to mean that the patient is at high risk of developing heart disease and anything lower may be taken to mean that risk is minimal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*plZXMk7pFlAI0K6w" /><figcaption>Risk score comparisons across all Deep Learning models (Source: <a href="https://youplusai.com/predict-cardiac-risk/">youplusai.com</a>)</figcaption></figure><p>The table above offers an explanation for why a certain patient is deemed at risk of heart disease. With this at hand, the clinician may be able to explain the reason for risk to the patient and even recommend certain actions that may help reduce that risk.</p><p>A few recommendations and actions taken by the clinician may be as follows.</p><p>— More physical activity and adequate sleep for Patient A.</p><p>— Discussion on available treatments for Patient B considering that patient’s medical history.</p><p>— Detailed conversation with Patient C regarding the patient’s family history.</p><p>— Patient D not at risk overall but needs to watch his or her lifestyle factors more closely as they may bump up the risk if left unregulated.</p><h3>A question to ponder</h3><p><strong><em>Will an explainable AI (XAI) system replace a clinician?</em></strong></p><p><strong>Absolutely not</strong>. An AI or an ML system is a tool in the clinician’s toolkit and does what it does best — <em>crunch data to arrive at insights</em>. This tool may save some valuable time for the clinician. That saved time may perhaps translate into a much better interaction between the patient and the clinician and foster the Doctor-Patient relationship.</p><p>With an active interest in Clinical Data Science, I will be exploring many more topics in this domain. If you’re interested in such endeavors, please join along my journey by following me on <a href="https://twitter.com/@youplusai">Twitter</a> and subscribing to the <a href="https://www.youtube.com/channel/UCQ9-sBJDOS1Ti4lfBSqwP_A">youplusai YouTube channel</a>.</p><p><em>Many thanks to </em><a href="https://www.linkedin.com/in/gopalan-tr-ba348822/"><em>Dr. T. R. Gopalan</em></a><em> for his clinical inputs and review.</em></p><p><em>Originally published at </em><a href="https://youplusai.com/clinical-notes-negation/"><em>youplusai.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6bca678fce9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/cardiovascular-risk-an-approach-to-predict-and-explain-it-too-e6bca678fce9">Cardiovascular Risk — An approach to predict and explain it too</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clinical Notes — The “Negative” Story]]></title>
            <link>https://medium.com/data-science/clinical-notes-the-negative-story-e1140dd275c7?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1140dd275c7</guid>
            <category><![CDATA[healthcare-ai]]></category>
            <category><![CDATA[clinical-research]]></category>
            <category><![CDATA[clinical-notes]]></category>
            <category><![CDATA[negation]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Thu, 03 Dec 2020 20:03:13 GMT</pubDate>
            <atom:updated>2020-12-03T20:03:13.407Z</atom:updated>
            <content:encoded><![CDATA[<h3>Clinical Notes — The “Negative” Story</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GiEbKiIqMO9mmf3MHPB3g.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/s/photos/david-travis">David Travis</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p><strong>Abstract:</strong><em> In this article, you will learn what a clinical note is, why understanding clinical notes may be useful, what are some special characteristics of such notes, what is negation and how may it be useful, what are ways in which information in a clinical note may be retrieved and some ideas to explore further once we have a basic understanding.</em></p><h3>The mission</h3><p>Clinical notes contain valuable information that helps develop a more complete understanding of the patient.</p><p>Our mission is to find out how we can extract what is commonly used in a clinical note — <strong>Negations</strong>.</p><p>(If you are already aware of what this is and would like to jump right into the code, click <a href="https://github.com/youplusai/clinical-notes-negation">here</a>).</p><p>Let’s dive in!</p><h3>What’s a clinical note?</h3><p>A clinical note is written by a clinician or a healthcare professional when providing clinical care for patients. It describes patients, their history be it medical, family, socio-economic, dietary, hereditary etc., their present illness or condition, any findings from the physical exam that was carried out (if patient history taking interests you, check out <a href="https://youplusai.com/epi-1-script/">this transcript</a> of the You+AI podcast episode — <a href="https://youplusai.com/epi-1/">the doctor-patient relationship</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tw9dhllVbe5rr0nK" /><figcaption>The various dimensions of Patient History (Source: <a href="https://youplusai.com/epi-1-script/">youplusai.com</a>)</figcaption></figure><p>It may also have details of lab tests that have been ordered, their results, the details of any procedures done, the medicines being taken by the patient and any dosage information.</p><p>Here is a sample of a clinical note that describes the condition of a patient when he showed up to seek care.</p><p><em>Patient is a 60 year old having difficulty in breathing. Not diabetic. He feels that he has been in good health until this current episode. Appetite — good. No chest pain. No weight loss or episodes of stomach pain. Hypertension absent.</em></p><p>Many more may be found at <a href="https://mtsamples.com/">https:/mtsamples.com/</a>.</p><h3>What is the point of parsing a clinical note and looking for interesting information?</h3><p>Clinical notes can yield a wealth of information when examined. Some uses are as follows.</p><ul><li>It adds to the primary diagnosis that has been done for the patient.</li><li>They act as references for the clinical team helping them in clinical decision support.</li><li>The patient history may be valuable in understanding what kind of patients present what types of conditions.</li><li>Mining clinical notes may help in the identification of new patterns of symptoms and disease.</li><li>Clinical notes may help add billing codes to the patient’s medical record.</li></ul><h3>In what ways is a clinical note different from regular language?</h3><p>A clinical note is written as part of medical care that is given. It may not be grammatically correct, it will most likely have spelling errors, it may have short phrases and a number of abbreviations and acronyms and there is hardly any standardization i.e. it will vary from one hospital or clinic to another and even from one clinician to another.</p><p><strong>Negation</strong> — A typical clinical note in addition to reporting the conditions that the patient has, also reports the conditions that a patient does not have. This is important to have a better medical understanding of the patient. This is not something that you would see in a pronounced manner in regular language.</p><p>Examples of Negation</p><ul><li>Not diabetic.</li><li>No chest pain.</li><li>No weight loss or episodes of stomach pain.</li><li>Hypertension absent.</li></ul><p><strong>Context</strong> — This refers to a condition that a patient had previously or a relevant condition that the patient’s family member had.</p><p>Examples of Context</p><ul><li>Patient’s mother and father developed Diabetes in their 50s.</li><li>Patient — long history of common cold.</li></ul><h3>What is our objective?</h3><p>Our objective is <strong>to identify the negations in the clinical note</strong> presented above. As stated earlier, negation allows for a more complete understanding of the patient.</p><p>Many of the NLP frameworks available today from the key providers say Amazon, Microsoft and Google have APIs that will accept English language text and identify many aspects in that text.</p><p>So, we will pass the clinical note through the <a href="https://cloud.google.com/natural-language">Google NLP API</a> and see what it yields. For contrast, we will also pass in text that is not a clinical note to see what comes out.</p><p><strong>Non-clinical text</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*SjOCTGneGDixidTz.png" /><figcaption>What Google’s NLP API detects in non-clinical text? (Source: <a href="https://youplusai.com/clinical-notes-negation/">youplusai.com</a>)</figcaption></figure><p><strong>Clinical text</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*lX4tNk64K5I3VpuK.png" /><figcaption>What Google’s NLP API detects in clinical text? (Source: <a href="https://youplusai.com/clinical-notes-negation/">youplusai.com</a>)</figcaption></figure><p>When comparing the results above, the following is evident.</p><ul><li>The API identifies a lot more entities in non-clinical English language text.</li><li>The API does not classify medical terms well i.e. diseases, medicines, treatments etc.</li><li>The API classifies some clinical terms in an unexpected manner.</li><li>Negation is not at all detected.</li></ul><p>So, this API may not be the best suited for clinical note parsing. This is also the reason why Google (and it’s competitors) have a separate, specific <a href="https://cloud.google.com/healthcare/docs/how-tos/nlp">Healthcare NLP API</a>. I will share my experiments with this API in a subsequent post.</p><p>At this time, our discussion will continue to explore Open Source Software (OSS) options to meet our objective.</p><h3>What do we proceed with?</h3><p>We use the following libraries and continue the work in Python.</p><ul><li><a href="https://spacy.io/">spaCy</a> — An open source NLP library in Python.</li><li><a href="https://spacy.io/universe/project/negspacy"><em>Negspacy</em></a> : A spaCy NLP pipeline object for identifying negation in text. Based on the NegEx algorithm.</li><li><a href="https://code.google.com/archive/p/negex/"><em>NegEx</em></a> : — NegEx is an algorithm that locates trigger terms indicating a clinical condition is negated or possible and determines which text falls within the scope.</li></ul><h3>Setting up the basics</h3><p>The first step is to install all these libraries in case you already don’t have them. Note that the model being used is a Spacy NER model trained on the BC5CDR corpus.</p><pre>pip install spacy<br>pip install negspacy<br>pip install &lt;Model URL&gt; en_ner_bc5cdr_md</pre><p><a href="https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.3.0/en_ner_bc5cdr_md-0.3.0.tar.gz">Model URL</a></p><p>The next step is to import the relevant modules into your python script.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3139e7ba5647efb2a4290a516e43091/href">https://medium.com/media/e3139e7ba5647efb2a4290a516e43091/href</a></iframe><h3>Specify the model and the clinical notes</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/36a9d6af9730ea6e95d1b27aca355d45/href">https://medium.com/media/36a9d6af9730ea6e95d1b27aca355d45/href</a></iframe><h3>Extraction of Negation Entities</h3><p>This comprises two parts — adding a Negex component to the NLP pipeline and then using that on every sentence of the clinical note to identify the negation entities. Once all of them have identified, they are printed in a list.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c94cfe833d018ce8af6c633c12afd7ee/href">https://medium.com/media/c94cfe833d018ce8af6c633c12afd7ee/href</a></iframe><h3>Printing out the final list</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f62cbcae4d3f654da74756ac333562d/href">https://medium.com/media/6f62cbcae4d3f654da74756ac333562d/href</a></iframe><h3>Expected vs. Actual findings</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*JPrdu2tjTgABY4sz" /><figcaption>Table from <a href="https://youplusai.com/clinical-notes-negation/">youplusai.com</a></figcaption></figure><p>From this table, we see that ‘Hypertension’ was not found as a negation entity. Note that the ‘absent’ keyword was used after ‘Hypertension’ in the clinical note.</p><h3><strong>Experiments to improve findings</strong></h3><p>A couple of ways that may be tried out to improve the findings are listed out below.</p><ol><li><strong>Change the clinical note</strong></li></ol><p>Change “Hypertension absent.” To “No Hypertension.”</p><p><em>Result:</em> Hypertension is recognized as a Negation Entity.</p><p><em>Note:</em> It is impractical to change the clinical note when considering a production use case. Therefore this experiment is only to show when a negation entity is easily recognized vs. when it isn’t.</p><p><strong>2. Use custom patterns in Negspacy</strong></p><p>Certain keywords or phrases that follow an entity and indicate negation (e.g. ‘absent’) may be added to Negex. In our example, this means changing the <em>negation_model()</em> function as follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47a7a8e78bcec38729dad1369b44d9e6/href">https://medium.com/media/47a7a8e78bcec38729dad1369b44d9e6/href</a></iframe><p><em>Result:</em> Hypertension is recognized as a Negation Entity.</p><p><em>Note:</em> This is more practical to implement but the challenge may be to find such preceding or following phrase patterns in all of the clinical text corpus under consideration.</p><h3>What could be other negation entity patterns that may be challenging to find?</h3><ul><li><em>Termination patterns</em> — Example: Diabetes denied, Stomach ache not present, Congestion none</li><li><em>Use of prefixes </em>— Example: Patient is non-diabetic, non-hypertensive.</li><li><em>Double negatives</em> — Example: The patient is not abnormal.</li><li><em>Symbols usage </em>— Example: Hypertension +, Diabetes –</li><li><em>Positive/Negative usage</em> — Example: Hypertension positive, Diabetes negative.</li><li><em>Yes/No phrases</em> — Example: Hypertension — No, Diabetes — Yes, Urinary problems — No.</li><li><em>Use of more generic language than clinical terminology</em> — Example — No complaint of high sugar (rather than No Diabetes).</li></ul><p>This only means we need to test our solution more and more with a rich dataset of clinical notes to iron out as many cases as possible.</p><h3>Big picture ideas!</h3><p>Mining negations in clinical notes is a way of mining useful information from unstructured data. Besides the use cases that we have delved into above, I see a few big areas this may have a significant impact in.</p><ol><li><strong>Building disease correlations</strong></li></ol><p>As an example, when reviewing clinical cases in a specific area, say infectious diseases as part of an Mortality &amp; Morbidity (M &amp; M) Review, a diagnosis of typhoid but with a negation entity of fever being documented in the clinical note may either point to an incorrect diagnosis or to an erroneous note.</p><p>So, analyzing a large volume of clinical notes may provide us the correlations that exist between diseases and symptoms. This may especially help for rare diseases.</p><p><strong>2. Discovering best practices</strong></p><p>Clinical notes taken within various medical departments of a hospital may be compared or clinical notes taken by the same specialty department, say gastroenterology may be compared across hospitals to discover the typical patterns of patient history taking or discharge summaries. The best practices in clinical note taking may surface from this and this may help inform clinical management.</p><p><strong>3. Teaching</strong></p><p>Taking down patient conditions when they get admitted and noting down patient history is an important aspect that is taught to medical students. In addition to having a repository of digital clinical notes, an understanding of correlations mined from these notes, best practices gleaned and the extent to which information from clinical notes may be mined to discover new insights may drive home the importance of taking down such notes in adequate and appropriate measure.</p><h3>Closing thoughts</h3><p>In this article, we started with what a clinical note is, explored what kinds of information may be available in such a note, pondered about how does negation play a role in understanding the patient’s condition better, tinkered with ways to extract the negation entities and experimented with ways to improve our solution.</p><p>This investigation project is one of many ideas that I would like to explore around healthcare data mining. I believe there’s huge potential in the application of Machine Learning in Healthcare but we need to peel one layer at a time.</p><p>Some more ideas to take this further may be –</p><ul><li>Identify further interesting negation patterns in clinical notes — crowdsourcing will certainly help.</li><li>Try out the Healthcare NLP API from one of the big 3 cloud vendors — Amazon, Microsoft and Google. Identify what more does that achieve over what OSS does.</li><li>Compare the Healthcare NLP API of the big 3 cloud vendors.</li></ul><p>I will be exploring these and more in this area. If you’re interested in such endeavors, please join along my journey by following me on <a href="https://twitter.com/@youplusai">Twitter</a> and subscribing to the <a href="https://www.youtube.com/channel/UCQ9-sBJDOS1Ti4lfBSqwP_A">youplusai YouTube channel</a>.</p><p><em>Many thanks to </em><a href="https://www.linkedin.com/in/gopalan-tr-ba348822/"><em>Dr. T. R. Gopalan</em></a><em>, </em><a href="https://www.linkedin.com/in/madhucharis/"><em>Madhusoodhana Chari</em></a><em>, </em><a href="https://www.linkedin.com/in/umashankar-s-95b9a05/"><em>Umashankar S</em></a><em> and </em><a href="https://www.linkedin.com/in/kurtispykes/"><em>Kurtis Pykes</em></a><em> for their feedback on this blog.</em></p><p><em>Originally published @ </em><a href="https://youplusai.com/clinical-notes-negation/"><em>youplusai.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1140dd275c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/clinical-notes-the-negative-story-e1140dd275c7">Clinical Notes — The “Negative” Story</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BlueDot — Spotting disease outbreaks with human expertise and AI]]></title>
            <link>https://youplusai.medium.com/bluedot-spotting-disease-outbreaks-with-human-expertise-and-ai-c6aea8d3f37a?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6aea8d3f37a</guid>
            <category><![CDATA[pandemic]]></category>
            <category><![CDATA[bluedot]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[outbreak]]></category>
            <category><![CDATA[infectious-disease]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 14:33:50 GMT</pubDate>
            <atom:updated>2020-04-16T03:59:15.280Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*Nn0bNboKRFzqZrTUjKnX6Q.png" /></figure><h3>BlueDot — Spotting disease outbreaks with human expertise and AI</h3><p>BlueDot’s mission is to <strong>protect people around the world from infectious diseases with human and artificial intelligence. </strong>Their system<strong> </strong>became aware of the pneumonia cases (now called COVID19) in Wuhan on December 31–2019. They publicly released their findings in the <a href="https://academic.oup.com/jtm/advance-article/doi/10.1093/jtm/taaa008/5704418"><em>Journal of Travel Medicine</em></a> on January 14–2020. An article in the <a href="https://www.wired.com/story/ai-epidemiologist-wuhan-public-health-warnings/"><em>WIRED magazine</em></a> on January 25–2020 featured BlueDot and their now famous findings. Let’s take a closer look into how BlueDot’s solution works.</p><p><strong>Why do we need to keep an eye on disease outbreaks?</strong></p><p>This question perhaps does not need an answer now, given that the entire world is living with the COVID19 pandemic and knows what that means. Speed is key in spotting outbreaks as every day lost has severe consequences for human life.</p><p>History reveals that infectious disease outbreaks like those of SARS-1 or MERS or now COVID19 are not reported fast enough from the epicenters. Though there are worldwide protocols for disease communication and world bodies like the WHO governing these, they are not enforced enough. Governments of countries where outbreaks have occurred take time to assess the impact and weigh the severe economic consequences of reporting the same. This why we need alternate systems to keep track.</p><p><strong>How has such a system been built by BlueDot?</strong></p><p>BlueDot’s system comprises of 4 key components: Surveillance, Dispersion, Impact and Communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKc5VI84ppD4VQ_3nitSQQ.png" /><figcaption>SURVEILLANCE</figcaption></figure><p>Human experts — Epidemiologists and Clinicians frame what is relevant in the context of the most important infectious disease outbreaks. An AI system then trains to pick these out from a sea of online articles spread across multiple languages. When deployed, techniques such as NLP are used to crunch the incoming data from articles on the web into a small number of alerts that may then be analysed by human experts who deem it to be a real red flag or a false alarm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r-iGX8onfA9mlMhI6SHTvQ.png" /><figcaption>DISPERSION and IMPACT</figcaption></figure><p>Once the outbreak is confirmed as a genuine red flag, the next step lies in finding out where this outbreak will spread to. In this age of globalization, people travel all around the world and the pathogen is carried on these very human carriers throughout the earth. To understand this dispersion, the flow of people outward from the outbreak epicenter by air, sea and land is tracked. While air travel is assessed via monitoring flight ticket sales, anonymized location data from ~400 million mobile phones yields information on where people move via land and sea. This helps ascertain which other towns or cities that get most of these travelers are going to become the next hot-spots for the disease. An understanding of the local weather in those towns and cities as well as an idea of the public health infrastructure helps assess overall impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*VKSrz4CkbL51381l0w_ivg.png" /><figcaption>COMMUNICATION</figcaption></figure><p>The Governments of those towns and cities as well as the relevant public health officials and airport authorities as well as national defense authorities now need to be notified as soon as possible so that appropriate preparations may be made to contain or mitigate the outbreak impact. Post identifying the COVID19 outbreak in Wuhan, BlueDot’s system published it’s findings that stated that the next set of cities to be affected would be Tokyo, Bangkok, Hong Kong, Seoul, and Taipei.</p><p><strong>Takeaways</strong></p><ol><li><strong>Human Expertise + Artificial Intelligence is a winning combo</strong></li></ol><p>Humans frame the problem, AI crunches the data and looks for the key terms of interest and then human experts identify the real red flags from the false alarms. Humans use their power of intuition and machines use their power of computation — that results in an incredibly useful solution for the public.</p><p><strong>2. A possible pandemic alert service</strong></p><p>Though this system notifies specific organizations and government bodies, the question to ask is whether this service may be extended to the public at large to act like a Pandemic alert service. This would allow the public to prepare fast and also put pressure on their local, state and nationwide public health and Government officials to take prompt action.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6aea8d3f37a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tracking back from a Pandemic]]></title>
            <link>https://youplusai.medium.com/tracking-back-from-a-pandemic-aee613e2831c?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/aee613e2831c</guid>
            <category><![CDATA[pandemic]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[cdc]]></category>
            <category><![CDATA[virus]]></category>
            <category><![CDATA[zoonoses]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 16:02:45 GMT</pubDate>
            <atom:updated>2020-04-06T04:23:06.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PL5gF1rQG1EM2xh4OYHOiQ.jpeg" /><figcaption>Illustration by Vidya Gopal (Insta: spink_bottle)</figcaption></figure><p>It is our fancy to call a certain block of time, a certain age — the stone age, the industrial age, the information age etc. Until recently, this age was known as the “Artificial Intelligence Age” given the widespread impact that AI was beginning to have on our lives.</p><p>That nomenclature has probably been upset by the emergence of COVID-19, a disease caused by the SARS-COV2 virus that has now been deemed a Pandemic by the WHO. Given the widespread infection across countries in almost all continents of the world, the almost exponential growth of the number of infected cases per day, the never before norms that are being thought of as being vital i.e. Social Distancing, Quarantine, this may truly be termed as perhaps the Pandemic Age or the Quarantine Age.</p><p>The COVID19 age has brought humanity together with a sense of purpose that I have never seen before in my life. Neither religion nor faith nor economic downturns have managed to bring humanity together as one species. That may be because a pathogen like COVID19 knows no borders — no geographical fault lines, no race, no religion, no color, no gender, no age and no sexual preference — in that, it is truly “Universal”.</p><p>The biggest challenge that the world seems to be tackling now is a race to find a cure, a therapy or a vaccine. Those who know portend that unless that is done, life as we knew it and the freedoms that we enjoyed as a people may never be the same. The adversary for life and liberty this time around isn’t a hostile country or aliens or the state but an invisible but potent pathogen. Researchers in their labs are racing against time to find that miraculous cure or vaccine — this is the highest priority — governments are supporting it, regulatory authorities are easing the norms, funding is being arranged, all options are being evaluated with no stone un-turned. As of this writing, the first trial of a vaccine has been given to a human volunteer who would now be observed for an extended length of time. Perhaps, there will be many more such trial vaccines before one is found to work for humanity at large.</p><p>I applaud all the research effort in shrunk timelines and all the policy makers that are bending the rules to make sure there are no obstacles in this effort — kudos to every one of them — the whole world is waiting with bated breath to hear some good news on this front and soon.</p><p>That said, I see this as yet another effort to find a “drug” that will make the symptoms go away without exploring the larger and holistic question of what are the background reasons that contributed to the situation getting this far. Taking a Tylenol or Panadol makes the fever go away or taking an Ibuprofen makes the pain go away but note that the fever and pain may just be external manifestations of a problem that lies much deeper within. An infection may be triggering the fever and an internal bleed may be causing the pain.</p><p>So, where do we begin our journey to find the underlying reasons that got us here? What may such a journey reveal to us humans about ourselves?</p><p>As you may have heard, COVID-19 as well as SARS or MERS or Bird Flu or Swine Flu are all Zoonotic diseases or Zoonoses. Zoonotic diseases are caused by harmful germs like viruses, bacteria, parasites, and fungi that inhabit animals referred to as reservoir hosts. Note that these germs may not cause any harm to the reservoir hosts but when they spread to their human hosts, they end up causing illness which could even lead to death. That’s because humans do not have natural immunity to these germs that inhabit non-human reservoir hosts. When infected with these germs, it takes time for the human body to recognize this as a foreign body and mount an immune response (more on immunity in a later article). The antibodies and immune cells that are generated from this immune response fight off the disease causing pathogen.</p><p>The question to ask then is why does a virus crossover to humans? Is this a chance event in nature? What factors increase the odds of this chance event?</p><p>This question led me to explore more questions — which animal hosts act as reservoirs for viral zoonoses, what makes viruses leap to humans and is there any connection between human activity and the pandemics that we have seen in the past and the one we are living through now?</p><p>There is a whole body of research done on these questions and it involves a number of experts from different fields — Ecologists who study environments and habitats, Veterinarians who cater to the well being of pets and farm animals, Virologists who are routinely on the lookout for never been seen viruses, Farmers and Ranch owners who often are the first ones to be at the receiving end of an epidemic that affects the farm animals or poultry, Researchers who travel to the jungles, caves, rivers as well to the live animal markets to trace out the whiff of a potential new outbreak etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_Ou1cxy_lsyIXbF4_axfA.png" /></figure><p>The <a href="https://www.cdc.gov/onehealth/basics/zoonotic-diseases.html">USA CDC</a> has information on Zoonotic diseases which describes the ways in which Zoonotic germs may spillover from reservoir animal hosts to humans — by direct or indirect contact with animals and animal fluids, being food or water borne or due to insect vectors that bite the reservoir hosts and then humans.</p><p>I came across some excellent articles written on the subject by some experts in this area. A couple of excerpts that really made me sit up and think are listed below the article link.</p><ul><li><strong>We made the Coronavirus Epidemic</strong> by <em>David Quammen</em> in <a href="https://www.nytimes.com/2020/01/28/opinion/coronavirus-china.html?smtyp=cur&amp;smid=tw-nytopinion">The New York Times</a>.</li></ul><p>“… this Wuhan emergency is no novel event. It’s part of a sequence of related contingencies that stretches back into the past and will stretch forward into the future, as long as current circumstances persist.”</p><p>“Long term: We must remember, when the dust settles, that nCoV-2019 was not a novel event or a misfortune that befell us. It was — it is — part of a pattern of choices that we humans are making.”</p><ul><li><strong>Destruction of Habitat and Loss of Biodiversity are creating the perfect conditions for diseases like Covid-19 to emerge</strong> by <em>John Vidal</em> in Ensia.</li></ul><p>“Pathogens are crossing from animals to humans, and many are now able to spread quickly to new places. The U.S. Centers for Disease Control and Prevention (CDC) estimates that three-quarters of “new or emerging” diseases that infect humans originate in nonhuman animals.”</p><p>“Wet markets make a perfect storm for cross-species transmission of pathogens,” says Gillespie. “Whenever you have novel interactions with a range of species in one place, whether that is in a natural environment like a forest or a wet market, you can have a spillover event.”</p><p>Digging more into this domain, I found a number of books that have been written on the subject by various authors. Here is a list of them (in no specific order or preference).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wb7RGg7L7yRCpYVx" /></figure><p>There’s even a new series on Netflix titled Pandemic (2020) that digs into how these pathogens crossover to humans resulting in pandemics. Besides this, there are several movie titles on similar themes like Outbreak(1995), Contagion(2011) and Virus(2019). Of these, I especially like Virus which is an Indian Malayalam movie that focuses on the Nipah virus outbreak in the state of Kerala in India in 2018. What touched me in the movie was the sensitive portrayal of how the community dealt with such an outbreak despite the commotion, confusion, social stigma and lack of the best medical facilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*fHsL-ZQxe-klVOdx7S0oQA.png" /></figure><p>From the digging that I have done so far, it seems clear that human activity has a clear and unambiguous role in contributing to the spillover of pathogens into humans that lead to pandemics. <em>David Quammen</em> in his book <strong>Spillover </strong>lays out this argument wonderfully in clear terms, a gist of which is as follows -</p><ol><li>Indiscriminate human activity in the name of development or the need to drive the economy and fulfill the needs of the 7+ billion people on earth is tearing apart nature’s ecosystems — logging of forests, slash and burn agriculture, wild game hunting, quarrying, rapid urbanization, mining, unsustainable fishing in the oceans, massively scaled up poultry farming and animal rearing, destruction of wildlife habitats, human animal conflict etc.</li><li>Viruses and millions of creatures like bacteria, fungi, protists and other organisms live within natural ecosystems — these are mostly unknown to humans as they have never been found or classified into a species and they live within reservoir host organisms that may be themselves undiscovered yet.</li><li>By destroying natural ecosystems, these microbes including viruses are shaken loose. When they get evicted from their natural hosts, they need to find a new home, a new host and most often humans are it because they are available in abundance at these hotspots of ecosystems’ destruction. Note that these microbes are not essentially looking out for humans to jump on but just that humans happen to be readily available.</li><li>Having made the leap to humans, zoonotic microbes have to survive and replicate in their human hosts. Some, in the process, end up killing their human hosts too soon and therefore are less successful in spreading to other human hosts e.g. Ebola. Some successfully establish themselves within their human hosts and spread e.g. HIV, SARS-COV2 etc.</li></ol><p>Humans in order to feed the billions of them are also creating unnatural environments and procedures as may be seen in poultry or cattle or pig farming.</p><p>In the case of poultry, hundreds of thousands of chickens (if not millions) are placed in confined spaces with limited or no mobility. This typically would not be the case if the chicken were grown in more natural environments (free range chicken) for a family at the farm or in a village to sustain a group of families at best. In these massively scaled up poultry farms, the chickens are fed growth hormones and antibiotics as their natural immunity is decreased to a very large extent. The use of antibiotics has several other effects on the chicken population such as weight gain and there are subsequent dangers of antibiotic rich effluents from these farms polluting the nearby water bodies (more on antibiotics in a later article). A pathogen can easily spread among the chickens rapidly and decimate the entire chicken population and pose a risk for immediate spillover to human handlers of poultry. The same case holds true for cattle farming as well where cattle are reared in small spaces and fed a diet designed to boost meat or milk yield curated with supplements like growth hormones and antibiotics.</p><p>The desire for game and exotic meat have given place to the growth of “wet markets” where wild animals are kept caged and slaughtered in front of customers based on their choice. Note that wet markets are mostly unregulated i.e. there are no hygiene and safety norms to be taken care of and neither is there any enforcement of such norms. Such wet markets are places where humans have a high probability to come in contact with bodily fluids of wild animals, birds, rodents and insects and these present an opportunity for the spillover of viruses from their reservoir hosts (wild animals) to humans who become the new hosts.</p><p>Perhaps a century ago, a spillover that led to an outbreak could’ve been contained locally. With globalization, the ease of air travel for people and the shipments of goods across every part of the world, it becomes almost impossible to contain an outbreak locally. Viruses ride on their new hosts — humans, as humans fly across countries and what started as a local outbreak quickly turns into a global pandemic as evident in the case of COVID-19.</p><p>Today, it is heartening to see the purpose with which all arms of the governments, policy makers, world organisations, the medical fraternity, industry, civil society and every common citizen are contributing to contain or mitigate this pandemic and see a way out of it.</p><p>That said, when we get out of this experience in the long term, and <strong>get out we will</strong>, we as a people, <strong>must not dismiss this just as a “one-off random chance event” or as an “act of God” </strong>but rather introspect into how our way of life, our own needs and wants and our own greed has been a major factor behind the pandemic. If we do move on just as before, then our normal way of life will be peppered with newer pandemics occurring at a more quicker rate, each one establishing <strong>a “new normal” for us</strong>.</p><p>(A big thank you for her inputs — <strong>Revati Masilamani</strong>, an Immunology and Infectious Diseases Researcher with the <strong>Center for Science Education, Tufts University School of Medicine</strong>. Check out their Twitter: @greatdiseases)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aee613e2831c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Did AI select you as a candidate for a promotional offer?]]></title>
            <link>https://youplusai.medium.com/did-ai-select-you-as-a-candidate-for-a-promotional-offer-4b37482aaa76?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b37482aaa76</guid>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[explainable-ai]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Fri, 13 Sep 2019 05:54:36 GMT</pubDate>
            <atom:updated>2019-09-13T05:54:36.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*lMDEFVdWNgvngLMmXsw6sA.png" /><figcaption>Did AI select you?</figcaption></figure><p>Let us take a use case where a company that owns a popular, leading job portal with millions of users wishes to roll out a new training course on — <em>How to prepare for Data Science interviews?</em></p><p>The company wishes to identify a pilot user group of say few hundreds of users who will be contacted regarding this new course offering.</p><p>A given user’s activities on the job portal typically comprises of — updating skills or completion of courses or certifications gained in the Resume, connecting to more users, following key Influencers in a chosen field, publishing new content be it posts, articles, audio clips, videos etc., following hashtags, volunteering for initiatives, recommending other users, receiving recommendations, receiving skills endorsements and so on.</p><p>These lead to the different attributes that give information about the user. These attributes across all the users makes up the data that will help in selecting the pilot user group. Note that data also includes (as a label) information about whether the user responded to a similar course offering in the past or not.</p><p><strong>How can a pilot user group be selected from the vast user base?</strong></p><p>To crunch this data, derive insights and select a pilot user group, a Machine Learning system, specifically a Recommendation Engine is deployed.</p><p><strong>What is a Recommendation Engine?</strong></p><p>Recommendation Engines or Systems, also referred to as Information Filtering systems are a class of algorithms that aim to provide the most relevant information of interest to the user by filtering it from of a much larger information base. Recommendation Engines discover data patterns in the data by learning users’ choices and produce results that closely match the users’ interests. A couple of examples are Netflix’s movie recommendations and Amazon’s product recommendations as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*g5C2_IBiDlc820gYBt3mfg.png" /><figcaption>Netflix movie recommendations</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*UaF3vn4fSKkQuxdV.jpg" /><figcaption>Amazon product recommendations</figcaption></figure><p>Given the data, the Recommendation Engine arrives at the short list of hundreds of pilot users who may be contacted about the new course offering. As the e-mails are getting ready to roll out to the selected pilot user group, a pertinent question is asked — W<em>hy has User A been chosen to be contacted for the promotional offer and not User B?</em></p><p>The <strong>Black Box</strong> nature of the Recommendation Engine model mechanics offers no help to answer such a question.</p><p><strong>What would help explain the recommendation given?</strong></p><p>If there were answers like one or more of the following, it would explain the recommendation and certainly help in sending out customized e-mails to members of the pilot user group.</p><p>· User A was selected as, this user completed an industry certification recently and has made updates to his or her Resume more than 7 times in the last month.</p><p>· User A was selected as, this user has grown his or her connected social network by more than 10 % in the last two weeks.</p><p>· User A was selected as, this user has increased by more than 15 % his or her following of Data Science, AI, ML groups and Influencers in the last 3 months.</p><p><strong>How could these explanations be arrived at?</strong></p><p>To address the gap in explainability of the decisions taken, consider these features grouped into buckets that have some semantic meaning. These buckets could be imagined as follows for this use case.</p><p><strong>Achiever</strong>: number of skills updated, number of additions to accomplishments, number of certifications added, number of overall updates to Resume etc.</p><p><strong>Creator: </strong>number of posts written, number of articles written, number of engagements on created content, number of comments given, number of recommendations given and received, number of skills endorsements given and received etc.</p><p><strong>Socializer</strong>: number of Influencers followed, number of new connections made, number of hashtags followed, rate of growth of network etc.</p><p>Now, we could have separate <strong>Component Models</strong> (models that are trained on a set of related features only) that would classify whether a user is selected or not in the pilot group and give a score for the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*pHSlUdMAdJTUx5PG.png" /></figure><p>The <strong>Decision Tree Classifier</strong> may be used for building <strong>Component Models</strong> in this case as the goal is to address <em>explainability</em>. A Decision Tree is a simple but powerful learning and classification model that is used in supervised machine learning. A Decision Tree is a classifier in the form of a tree that contains decision nodes and leaves. As shown above, each internal node represents a <em>test</em> on an attribute, each branch represents the <em>outcome</em> of the test, and each leaf node represents a <em>class label</em> (decision taken after computing all attributes). The paths from root to leaf represent <em>classification rules</em>. These <em>classification rules</em> provide the explanation of how a decision was reached i.e. why an instance was classified with a certain <em>class label</em>.</p><p>Now, the results of all the<strong> </strong>component models<strong> </strong>are compared for each prediction as shown in the table below. The prediction score is a score that indicates the probability of a user selected for the pilot user group. This is typically expressed as a probability between 0 and 1. To illustrate this use case better, consider that a score of 0.6 and above may be taken to mean that the user is selected in the pilot user group and anything lower means that the user is not selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*fB2CYMILJM8oHuUO9MPCTw.png" /><figcaption>Component Model scores for selected users</figcaption></figure><p><strong>What more can be done with explanations?</strong></p><p>The table above offers an explanation for why a certain user was selected to be a part of the pilot user group. With this at hand, such a selected user may be contacted with a personalized e-mail (that wouldn’t be possible without the explanations from component models). Some examples could be —</p><p>User A is contacted with an e-mail that this course will offer <strong><em>a completion certificate that could be showcased</em></strong> on his or her profile in the portal.</p><p>User B is contacted with an e-mail about the promotional offer further stating that <strong><em>a certain number of people in his or her networked community have also been contacted</em></strong> for the offer.</p><p>User C is contacted with an e-mail that this course will have an active discussion forum where Q &amp; A will be encouraged and <strong><em>a</em></strong> <strong><em>user will get credits for active engagement</em></strong> in the forum.</p><p>Such explanations thus give a meaningful way to engage with the user. With such personalization, there may be a higher likelihood for users from the selected pilot group to sign up the promotional offer.</p><p><strong><em>Note:</em></strong><em> The component models do not replace the Black Box Recommendation Engine but supplement it for better explainability. In this approach, the Black Box model provides the accuracy and performance whereas the component models provide the necessary explanation for the objective at hand.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b37482aaa76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decision Tree: Rule generation leading to programming thresholds @ the Network Edge]]></title>
            <link>https://youplusai.medium.com/decision-tree-rule-generation-leading-to-programming-thresholds-the-network-edge-478ebcab7f81?source=rss-c24311bd5101------2</link>
            <guid isPermaLink="false">https://medium.com/p/478ebcab7f81</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[decision-tree]]></category>
            <dc:creator><![CDATA[Ranga Sampath (youplusai)]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 15:36:54 GMT</pubDate>
            <atom:updated>2019-09-02T08:41:00.330Z</atom:updated>
            <content:encoded><![CDATA[<p>A Decision Tree is a simple but powerful learning and classification model that is used in supervised machine learning. A Decision Tree is a classifier in the form of a tree that contains decision nodes and leaves. As shown in Figure 1, each internal node represents a <em>test</em> on an attribute, each branch represents the <em>outcome</em> of the test, and each leaf node represents a <em>class label</em> (decision taken after computing all attributes). The paths from root to leaf represent <em>classification rules</em>. Once the decision tree classifier is built, a new instance is classified according to the <em>generated classification rules</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*TCtNaDZuFSbYLDlDOFXgKQ.png" /><figcaption>Figure 1: Decision Tree Classifier</figcaption></figure><p>The key advantage of a Decision Tree is that it may be easily interpreted and visualized by humans. Further, when using a Decision Tree, the most important attributes float to the top of the Decision Tree (based on maximum <em>Information Gain</em>) indicating the key deciding factors for classification.</p><p>The <strong>Network Edge</strong> is where users connect to the network. This is also where IoT (Internet of Things) devices connect. A large number of exploits and security vulnerabilities related to IoT devices have made news in the recent past. IoT devices are special purpose devices embedded in a system or workflow. Once IoT devices are deployed in production, there is great reluctance to update software unlike mobiles/laptops. This is because IoT devices aren’t typically designed to cater to non-disruptive updates. Most often software updates need manual intervention and result in device downtime. That said, the good news is that the focused purpose of these devices creates a limited set of behaviors that can be observed on the network and this constitutes the IoT device’s <strong>unique network signature</strong> (see below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YaVcayuh3Q15lVT_Xbb0jw.png" /><figcaption>Figure 2: IoT device network signatures from <a href="http://datworkshop.org/papers/dat16-final37.pdf">A Smart Home is No Castle</a></figcaption></figure><p>It can be seen from Figure 2 that the <strong>Belkin WeMo</strong> Switch has a network signature only when it transitions from <em>ON</em> to <em>OFF</em> and vice versa. <strong>Amazon Echo</strong>’s network signature starts only when the catch phrase <em>Alexa</em> is used. Should this device be compromised with malware, spyware or ransomware, the <strong>change in network signature</strong> can be quickly detected and suitable alerts raised. To do this <strong>Anomaly Detection </strong>at the Network Edge, we need <strong>Machine Learning</strong><em>.</em></p><p><strong>Dataset</strong></p><p>To illustrate this method better, consider the IoT packet traces available at <a href="http://149.171.189.1/">UNSW IoT</a>. These packet traces are across 21 different IoT devices like badge readers, light bulbs, smart plug switches etc. When these packet capture *.pcap files are run through an open source tool <a href="https://www.wireshark.org/docs/man-pages/tshark.html"><em>tshark</em></a>, a flow dataset is derived.</p><p><strong>Data preparation</strong></p><p>Consider the objective of identifying whether a flow record belonged to a certain IoT device or not e.g.<a href="https://www.belkin.com/us/c/wemo"> <strong>Belkin WeMo Smart Plug Switch</strong></a>. To do this, one of only two labels are assigned to all the flow records — <em>IoT-Smart-Plug-Switch</em>, for all flow records that had the source MAC address of the Belkin WeMo Smart Plug Switch and <em>Not-IoT-Smart-Plug-Switch</em> to all other flow records. This dataset post labeling and with the choice of specific features (no. of packets — tx and rx, number of bytes — tx and rx, packet TTL, protocol etc.) became ready to be fed into a Supervised Machine Learning method. For a simple explanation of Supervised Learning, listen <a href="https://twitter.com/youplusai/status/1158782263049379840">here</a>.</p><p><strong>Data Classification</strong></p><p>The Decision Tree is chosen as the classification method as the problem is that of <em>Binary Class Classification</em> (either <em>IoT-Smart-Plug-Switch</em> or <em>Not-IoT-Smart-Plug-Switch</em>). The resulting Decision Tree has 29 nodes and 15 leaves. Of these, 7 leaves had a label of <em>IoT-Smart-Plug-Switch </em>and the rest 8 leaves had the label as <em>Not-IoT-Smart-Plug-Switch. </em>Most importantly, this yielded clear rules (paths from nodes to leaves) that would identify whether the device was <em>IoT-Smart-Plug-Switch </em>or not. The rules for this case were —</p><p>If (flow data rate ≤ 70 KB/s) and (flow duration ≤ 55 s), label is <em>IoT-Smart-Plug-Switch.</em></p><p>If (flow data rate &gt;70 KB/s) or (flow duration &gt; 55 s), label is <em>Not-IoT-Smart-Plug-Switch.</em></p><p><strong>Rule Programming</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*Mo5VkezqOchYFY8932wVpg.png" /><figcaption>Figure 3: Rule programming on the network switch ASIC</figcaption></figure><p>The convenience of getting clear rules is that these may be programmed as maximum thresholds on the <a href="https://en.wikipedia.org/wiki/Application-specific_integrated_circuit"><strong>ASICs</strong></a> of network switches @ the Edge (see Figure 3). <a href="https://en.wikipedia.org/wiki/IP_Flow_Information_Export"><strong>IPFIX</strong></a> that is standards based and supported on several vendor ASICs supports constructs to program thresholds such as <em>Maximum Flow Data Rate</em> and <em>Maximum Flow Duration</em>. When the traffic incident on such an ASIC exceeds the programmed thresholds, interrupts are raised to notify the program running on the CPU of the switch.</p><p><strong>Anomaly Detection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*YIaA-3NFHP2uohCvW07ONw.png" /><figcaption>Figure 4: Actual and Simulated network traffic of an IoT-Smart-Plug-Switch</figcaption></figure><p>A comparison of graphs in Figure 4 show the expected<em> IoT-Smart-Plug-Switch</em> traffic on the network based on the training data set vs. the simulated traffic that indicates a compromised IoT device. This simulated traffic when incident on the network switch triggered an interrupt (from the ASIC) as the threshold for the <em>Maximum Flow Duration</em> is exceeded. The leads to the correct detection of the simulated traffic as <em>Not-IoT-Smart-Plug-Switch </em>and subsequently flagged as an anomaly.</p><p>The approach described in this article demonstrates that apart from the obvious advantages of the Decision Tree classifier being explainable by humans, the rules generated are amenable to programming on the edge network switches. This offers key performance gains in detection of anomalies at the edge. In the absence of rule programming, the traffic incident on the switch ASIC would have to be sampled at the switch CPU, a flow record constructed, run via the built-up model and then the classification arrived at.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=478ebcab7f81" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>