<?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>Forem: Monika Sadlok</title>
    <description>The latest articles on Forem by Monika Sadlok (@msadlok).</description>
    <link>https://forem.com/msadlok</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1292231%2F143b746f-1a8c-41a3-97e2-3b3257bfedae.png</url>
      <title>Forem: Monika Sadlok</title>
      <link>https://forem.com/msadlok</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/msadlok"/>
    <language>en</language>
    <item>
      <title>MedScan Assistant — AI medication label reader for seniors, powered by Gemma 4</title>
      <dc:creator>Monika Sadlok</dc:creator>
      <pubDate>Thu, 14 May 2026 16:47:08 +0000</pubDate>
      <link>https://forem.com/msadlok/medscan-assistant-ai-medication-label-reader-for-seniors-powered-by-gemma-4-3kc6</link>
      <guid>https://forem.com/msadlok/medscan-assistant-ai-medication-label-reader-for-seniors-powered-by-gemma-4-3kc6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;MedScan Assistant helps elderly and visually impaired people understand their medication labels. Half of all medication errors happen because patients misread or misunderstand the label — especially people with low vision or cognitive decline.&lt;/p&gt;

&lt;p&gt;Point your phone at any medication label → Gemma 4 reads and interprets it → the app reads the result aloud in plain language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two markets supported:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🇺🇸 US Market — FDA Drug Facts panels, OTC/Rx labels&lt;/li&gt;
&lt;li&gt;🇵🇱 Polish Market — EU-format labels, Polish TTS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📷 Photo scan or manual text input&lt;/li&gt;
&lt;li&gt;🔊 Automatic voice readout (Web Speech API, language-matched)&lt;/li&gt;
&lt;li&gt;📅 Color-coded expiry status (green / amber / red)&lt;/li&gt;
&lt;li&gt;⚠️ Warnings and drug interactions&lt;/li&gt;
&lt;li&gt;🏥 "See a doctor if..." — symptoms requiring medical attention&lt;/li&gt;
&lt;li&gt;♿ WCAG 2.1 AA accessible (large buttons, aria-live, keyboard nav)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/monsad/medscan-assistant" rel="noopener noreferrer"&gt;https://github.com/monsad/medscan-assistant&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://monsad.github.io/medscan-assistant" rel="noopener noreferrer"&gt;https://monsad.github.io/medscan-assistant&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Model: &lt;code&gt;google/gemma-4-31b-it:free&lt;/code&gt; via OpenRouter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I chose Gemma 4 31B Dense for three specific reasons:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Native multimodal input&lt;/strong&gt;&lt;br&gt;
Gemma 4 processes label photos directly — no separate OCR step. Medication labels have irregular layouts, rotated text, and small fonts. The model understands the full visual context, not just extracted characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Structured medical reasoning&lt;/strong&gt;&lt;br&gt;
The model converts complex pharmaceutical terminology into plain-language JSON. &lt;code&gt;Acidum acetylsalicylicum 500mg&lt;/code&gt; becomes "Aspirin — pain reliever and fever reducer." I prompt it to return a strict JSON schema with fields for &lt;code&gt;brand_name&lt;/code&gt;, &lt;code&gt;directions&lt;/code&gt;, &lt;code&gt;expiry_status&lt;/code&gt;, &lt;code&gt;warnings&lt;/code&gt;, &lt;code&gt;see_doctor&lt;/code&gt; (symptoms requiring a doctor visit), and &lt;code&gt;voice_text&lt;/code&gt; for TTS readout.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Multilingual in a single model&lt;/strong&gt;&lt;br&gt;
The same model handles both FDA Drug Facts panels (English) and Polish EU-format labels — switching via market-aware system prompts. No translation APIs, no separate models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why 31B Dense over E4B:&lt;/strong&gt;&lt;br&gt;
For a patient safety application, accuracy matters more than latency. The 31B Dense model gives noticeably better results on complex dosing instructions, drug interaction identification, and expiry date parsing across formats (&lt;code&gt;EXP 04/26&lt;/code&gt; vs &lt;code&gt;04/2026&lt;/code&gt; vs &lt;code&gt;APR 2026&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MARKETS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;us&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;systemPrompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;You are a medication assistant for Americans...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ttsLang&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-US&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;pl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;systemPrompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jesteś aptecznym asystentem dla seniorów...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="na"&gt;ttsLang&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pl-PL&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="c1"&gt;// One model. Two prompts. Two languages.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;The hardest part was making Gemma 4 reliable enough for medical use. I use &lt;code&gt;temperature: 0.2&lt;/code&gt; and a strict JSON schema. The model occasionally wraps JSON in backticks, so &lt;code&gt;parseGemmaResponse()&lt;/code&gt; strips those automatically.&lt;/p&gt;

&lt;p&gt;Adding a dedicated &lt;code&gt;see_doctor&lt;/code&gt; field — symptoms requiring medical attention — was the most impactful UX improvement. Users shouldn't have to parse warning text to figure out when something is serious. Gemma 4 identifies these situations reliably when explicitly prompted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test suite:&lt;/strong&gt; 49 unit tests, zero npm dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/monsad/medscan-assistant
&lt;span class="nb"&gt;cd &lt;/span&gt;medscan-assistant
node tests/app.test.js
&lt;span class="c"&gt;# ✓ 49/49 passing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devchallenge</category>
      <category>gemma4</category>
      <category>gemma4challenge</category>
      <category>a11y</category>
    </item>
  </channel>
</rss>
