<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joti Lohana</title>
    <description>The latest articles on DEV Community by Joti Lohana (@jotilohana21).</description>
    <link>https://dev.to/jotilohana21</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4176660%2F3810a2ae-92b8-43c0-a8eb-c566d07f30fc.png</url>
      <title>DEV Community: Joti Lohana</title>
      <link>https://dev.to/jotilohana21</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jotilohana21"/>
    <language>en</language>
    <item>
      <title>MedScribe AI — An Agentic Radiologist's Assistant</title>
      <dc:creator>Joti Lohana</dc:creator>
      <pubDate>Thu, 15 Oct 2026 05:00:56 +0000</pubDate>
      <link>https://dev.to/jotilohana21/medscribe-ai-an-agentic-radiologists-assistant-40i0</link>
      <guid>https://dev.to/jotilohana21/medscribe-ai-an-agentic-radiologists-assistant-40i0</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fki6nukzl35x2l892y89b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fki6nukzl35x2l892y89b.png" alt=" " width="799" height="357"&gt;&lt;/a&gt;---&lt;br&gt;
title: "MedScribe AI — An Agentic Radiologist's Assistant Built with Open-Source AI"&lt;br&gt;
published: true&lt;/p&gt;

&lt;h2&gt;
  
  
  tags: devchallenge, hf26challenge, ai, healthcare
&lt;/h2&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Pakistan has approximately &lt;strong&gt;1 radiologist per 100,000 people&lt;/strong&gt; in rural areas. A patient in Nawabshah, Sukkur, or Larkana may wait days — sometimes weeks — for a chest X-ray report that a radiologist in Karachi hasn't had time to read yet.&lt;/p&gt;

&lt;p&gt;The tools that exist today make this worse, not better. Most diagnostic AI stops at a raw prediction — "Pneumonia: 87% confidence" — with no explanation, no report, no next step. A doctor in a rural clinic cannot act on that. They need a structured report, a recommended course of action, and ideally something their patient can actually understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MedScribe AI&lt;/strong&gt; was built to close that gap.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We Built
&lt;/h2&gt;

&lt;p&gt;MedScribe AI is an agentic radiologist's assistant. Upload a chest X-ray, and within seconds you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;full structured clinical report&lt;/strong&gt; — Findings, Impression, Recommendation, Urgency, Reasoning&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;plain-language patient summary&lt;/strong&gt; in English or Urdu 🇵🇰&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Grad-CAM heatmap&lt;/strong&gt; showing exactly which regions of the X-ray influenced the diagnosis&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;downloadable PDF&lt;/strong&gt; combining all of the above&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://medscrib-ai.streamlit.app/" rel="noopener noreferrer"&gt;https://medscrib-ai.streamlit.app/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Problem With AI in Healthcare
&lt;/h2&gt;

&lt;p&gt;Most AI tools for radiology are black boxes. They give you a number. They don't tell you why.&lt;/p&gt;

&lt;p&gt;A clinician who cannot explain &lt;em&gt;why&lt;/em&gt; the AI flagged something cannot defend that decision to a patient, a colleague, or a regulator. So they ignore the AI and go back to waiting for a radiologist.&lt;/p&gt;

&lt;p&gt;We built explainability in from the start — not as an afterthought. Grad-CAM highlights the exact lung regions that drove the prediction. The reasoning agent explains its confidence and flags uncertainty when it exists. The escalation agent triggers an alert when the case is critical, so a human radiologist reviews it first.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Stage 1 — Computer Vision Model
&lt;/h3&gt;

&lt;p&gt;We trained and benchmarked two models on the same held-out test set:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Accuracy&lt;/th&gt;
&lt;th&gt;Precision&lt;/th&gt;
&lt;th&gt;Recall&lt;/th&gt;
&lt;th&gt;F1-Score&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ResNet18 (fine-tuned)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;90.5%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;98.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;88.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;93.2%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DenseNet121 TorchXRayVision (zero-shot)&lt;/td&gt;
&lt;td&gt;63.8%&lt;/td&gt;
&lt;td&gt;94.8%&lt;/td&gt;
&lt;td&gt;53.3%&lt;/td&gt;
&lt;td&gt;68.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We chose ResNet18 — not because it had the highest precision, but because it had the highest &lt;strong&gt;recall&lt;/strong&gt;. In a clinical setting, missing a true pneumonia case (false negative) is far more dangerous than a false alarm. Recall is the number that matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grad-CAM&lt;/strong&gt; was applied to visualize which regions of the X-ray most influenced each prediction — making the model's reasoning visible to the clinician.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 2 — AI Agent Pipeline
&lt;/h3&gt;

&lt;p&gt;The pipeline runs as a chain of four agents using &lt;strong&gt;LangGraph&lt;/strong&gt; and &lt;strong&gt;Groq&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;👁️ Vision&lt;/td&gt;
&lt;td&gt;Runs CV model, returns detected pathologies + confidence scores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🧠 Reasoning&lt;/td&gt;
&lt;td&gt;LLM agent decides which tools to call (ReAct loop)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;📋 Reporting&lt;/td&gt;
&lt;td&gt;Generates structured clinical report + plain-language patient summary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🚨 Escalation&lt;/td&gt;
&lt;td&gt;Flags critical cases for immediate radiologist attention&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The workflow is &lt;strong&gt;not hardcoded&lt;/strong&gt;. The LLM decides which tools to call and in what order based on the input — this is a genuinely agentic system, not a scripted pipeline dressed up as one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM:&lt;/strong&gt; openai/gpt-oss-120b via Groq&lt;br&gt;
&lt;strong&gt;Framework:&lt;/strong&gt; LangGraph (ReAct agent)&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 3 — Application Interface
&lt;/h3&gt;

&lt;p&gt;Built with Streamlit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chest X-ray upload with language selector (English / Urdu)&lt;/li&gt;
&lt;li&gt;Clearly separated doctor-facing and patient-facing sections&lt;/li&gt;
&lt;li&gt;Downloadable PDF report including original X-ray + Grad-CAM heatmap&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Open Source AI?
&lt;/h2&gt;

&lt;p&gt;Every component of MedScribe AI is open source:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TorchXRayVision&lt;/strong&gt; — open-source medical imaging foundation model&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;openai/gpt-oss-120b via Groq&lt;/strong&gt; — open-weight LLM, fast inference&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LangGraph&lt;/strong&gt; — open-source agent framework, fully auditable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PyTorch + ResNet18&lt;/strong&gt; — open weights, reproducible training&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This matters for three reasons:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Privacy&lt;/strong&gt; — Patient X-rays never leave the clinic's control. No data is sent to a proprietary server. In healthcare, this is not optional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Cost&lt;/strong&gt; — A rural clinic in Sindh cannot pay $500/month for a closed AI API. Open models make the unit economics work. A clinic paying $30–50/month for preliminary AI triage is viable. That same service built on proprietary APIs is not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Trust&lt;/strong&gt; — Open weights mean the model can be audited, fine-tuned, and improved. A black-box API cannot be corrected when it's wrong. An open model can.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Would Pay For This?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private clinics in rural Pakistan and South Asia&lt;/strong&gt; with no on-site radiologist — they need a first-pass screening tool that flags critical cases before a radiologist opens the scan&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telehealth platforms&lt;/strong&gt; needing automated preliminary reports at scale&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hospital chains&lt;/strong&gt; processing high volumes of routine chest X-rays&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A clinic paying &lt;strong&gt;$50/month&lt;/strong&gt; for AI-powered preliminary triage is far cheaper than flying in a radiologist. That's the side hustle: open-source AI makes the economics work where closed AI doesn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;CV Model: PyTorch · ResNet18 · TorchXRayVision · Grad-CAM · scikit-learn&lt;br&gt;
AI Agents: LangGraph · Groq (openai/gpt-oss-120b) · ReAct&lt;br&gt;
App: Streamlit · Python&lt;/p&gt;




&lt;h2&gt;
  
  
  Limitations — We Are Honest About These
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tested on pediatric chest X-rays — performance drops on adult datasets (domain shift confirmed: accuracy fell from 90.5% to 65.7% on an external adult dataset)&lt;/li&gt;
&lt;li&gt;Agent output is not verified by a human clinician before being shown — this is a screening tool, not a replacement for a radiologist&lt;/li&gt;
&lt;li&gt;English and Urdu only for now&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Human-in-the-loop verification — radiologists correct AI findings, corrections feed back to fine-tune the model&lt;/li&gt;
&lt;li&gt;Expand beyond binary classification to detect multiple pathologies&lt;/li&gt;
&lt;li&gt;Domain adaptation for adult chest X-rays&lt;/li&gt;
&lt;li&gt;WhatsApp integration — so rural clinics can upload X-rays without a laptop&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;1 radiologist per 100,000 people. That is the reality in rural Pakistan.&lt;/p&gt;

&lt;p&gt;MedScribe AI does not replace radiologists. It makes sure the cases that need a radiologist most — the critical ones — get to one faster. And it makes sure the patients who will never see a radiologist at all get something: an explanation, in their own language, of what the AI found.&lt;/p&gt;

&lt;p&gt;Open source AI is not just a technical choice here. It is the only choice that makes this work.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built by a team of 6 from Pakistan 🇵🇰&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
