Inspiration

The most dangerous moment in wound care is not the injury itself. It's the waiting.

A patient notices their wound looks different — a little redder, a bit of discharge, the skin around it feels warm. They call the clinic. They're told to come in. They arrange transport. A swab is taken. The sample goes to a lab. The lab is backlogged. Two days pass. Three days. The patient waits.

During those 72 hours, bacteria don't wait. A superficial colonization that could have been treated with a simple dressing change becomes a deep tissue infection. What could have been managed with oral antibiotics now requires surgical debridement. What was salvageable tissue becomes necrotic. A wound that should have healed becomes a limb-threatening emergency.

This is not a hypothetical. It happens every day. Over 50 million surgical site infections occur globally each year. A diabetic foot ulcer leads to amputation every 20 seconds. The common thread in these tragedies is not lack of treatment — it's the gap between when a wound starts deteriorating and when someone with expertise realizes it.

We built ToxiGlow for that gap.

We built it because a home health aide changing dressings in a rural village should not have to wait 72 hours to know whether the redness she's seeing is normal healing or the beginning of a crisis. We built it because a son caring for his elderly mother's pressure ulcer at home deserves to know whether he should rearrange his entire day to get her to a clinic, or whether he can safely continue monitoring. We built it because the current system asks patients to bet their limbs on their ability to recognize subtle clinical signs they were never trained to see.

ToxiGlow is not a doctor on your phone. It does not diagnose. It does not prescribe. It does not replace the trained eye of a wound care specialist.

What it does is simpler and, we believe, just as important: it tells you when to worry.

It is an early detection system — a triage tool that looks at a wound photo and says, in plain language, "This needs attention now" or "This is healing as expected." It shrinks the dangerous window between deterioration and detection. It gives people the one thing the current system denies them: time to act before it's too late.

What it does

ToxiGlow is an early warning system for wound deterioration — not a diagnostic tool, not a doctor replacement, not a clinical decision-maker.

The core problem it solves: When a wound begins to deteriorate — infection taking hold, tissue breaking down, necrosis spreading — the signs are often visible before the patient feels pain or fever. But these visual signs require trained interpretation. The average person cannot distinguish healthy granulation tissue from infected slough, or normal healing redness from the spreading erythema of cellulitis. So they wait. And waiting is what turns a manageable problem into an emergency.

What ToxiGlow actually does:

Sees what the untrained eye misses. Using computer vision, ToxiGlow analyzes a smartphone photo of a wound and extracts objective measurements: the ratio of healthy tissue to dead tissue, the spread of redness beyond the wound border, the presence of suspicious fluid. These are the same visual markers a wound care nurse looks for — but ToxiGlow quantifies them and makes them visible to anyone.

Translates clinical signals into plain language. "65% granulation, 25% slough, erythema positive at 1.5cm spread" means nothing to most people. ToxiGlow converts these findings into: "Your wound shows early signs that need a doctor's attention within the next two days. There is spreading redness that may indicate the beginning of an infection. Don't panic — but don't wait."

Provides tiered urgency guidance, not diagnosis. ToxiGlow never says "You have an infection." It says: "Based on what I can see, the risk level is moderate. Here's what you should do next and how quickly." The output is always a recommendation about when to seek care, not a determination of what the condition is.

Creates a shareable record. The annotated image and assessment report can be sent to a healthcare provider, giving them immediate context before they even see the patient. This turns the waiting period from wasted time into preparation time.

What ToxiGlow explicitly does NOT do:

It does not diagnose any medical condition

It does not prescribe treatment

It does not tell anyone they are "fine" or can ignore a wound

It does not replace the need for professional medical evaluation

It does not make clinical decisions

The relationship is: Patient captures wound → ToxiGlow flags concern level → Patient knows how urgently to seek care → Clinician makes the actual diagnosis and treatment plan.

ToxiGlow lives in the gap between "I'm not sure if this is serious" and "The doctor says it's infected." It exists to make that gap shorter, safer, and less terrifying.

How we built it

ToxiGlow was built as a Streamlit application with a modular architecture separating the computer vision pipeline from the user interface layer.

Technical Architecture:

The system processes images through six sequential stages:

Stage 1 — Image Acquisition: We integrated webcam capture using streamlit-webrtc for live photo taking, alongside a drag-and-drop file uploader supporting JPG, PNG, and HEIC formats. Images are preprocessed for white balance correction and perspective normalization.

Stage 2 — Wound Segmentation: We use Meta's Segment Anything Model (MobileSAM), a lightweight 6MB distilled version of SAM, for zero-shot wound boundary detection. The model generates a binary mask isolating the wound from healthy skin. As a fallback, we implemented OpenCV's GrabCut algorithm with Otsu thresholding, which requires no downloaded model weights.

Stage 3 — Tissue Classification: Within the wound mask, we convert pixels to LAB color space — chosen because it is perceptually uniform and illumination-invariant. K-means clustering (k=4) separates tissue into four clinically relevant categories: granulation (red, healthy healing tissue), slough (yellow, inflammatory debris), necrosis (dark brown/black, dead tissue), and epithelial (light pink/white, new skin growth). Tissue percentages are calculated and rendered as a color-coded overlay on the original image.

Stage 4 — Infection Marker Detection: We analyze the peri-wound region (the 15% dilated area around the wound) in the LAB A-channel (red-green axis) to detect erythema — the spreading redness that signals inflammation or infection. Exudate is detected via brightness and saturation thresholds within the wound bed. These are rule-based algorithms derived from the Bates-Jensen Wound Assessment Tool, a clinically validated wound scoring system.

Stage 5 — Measurement Estimation: We detect reference objects using Hough Circle Transform (for coins) or ArUco marker detection. Known real-world dimensions (e.g., US quarter = 24.26mm diameter) provide pixel-to-millimeter conversion. Wound area is computed using Green's theorem on the detected contour, and perimeter is calculated from contour arc length.

Stage 6 — Assessment Generation: A composite severity score (0-100) is computed from weighted inputs: necrosis percentage (40% weight), infection risk score (30%), slough percentage (15%), and wound size (15%). This score maps to four severity tiers. A template-based narrative generator assembles plain-language descriptions from the extracted features. A deterministic rule engine maps severity and specific flags to one of four action recommendations.

Frontend: The UI was built with a design philosophy we call "Clinical Compassion" — communicating medical seriousness with warmth and accessibility. We used a clean white-and-blue palette, Inter typography, custom CSS animations including a pulsing severity indicator, SVG gauge visualization, Plotly donut charts, and CSS-based floating illustrations in the hero section. The interface is fully responsive across desktop, tablet, and mobile. All animations run at 60fps. The design meets WCAG accessibility standards for color contrast and touch target sizing.

Tech Stack:

Frontend: Streamlit, Custom HTML/CSS/JS, Plotly

Computer Vision: OpenCV, scikit-image, MobileSAM, scikit-learn

Numerical: NumPy, SciPy

PDF Generation: fpdf2

Deployment: Streamlit Cloud

We built ToxiGlow with a single design constraint that shaped every technical decision: it must never pretend to be a doctor. This meant no black-box deep learning models that output "Infected: 87%." Instead, we built an interpretable pipeline where every output is traceable to a specific, observable feature of the wound image. If ToxiGlow flags high infection risk, it can show you exactly why: the redness extends 2.1cm beyond the wound border, the wound bed contains 30% necrotic tissue, and there is visible exudate. Every finding is explainable, auditable, and based on clinically established wound assessment criteria.

Challenges we ran into

  1. Drawing the line between "helpful warning" and "dangerous overreach" This was our hardest challenge, and it wasn't technical — it was ethical and design-oriented. How do you build a tool that flags danger without making people panic? How do you communicate urgency without implying diagnosis? We went through seven iterations of the recommendation language. "Infection detected" became "Signs consistent with possible infection." "Seek immediate care" became "We recommend seeking clinical assessment within 24 hours." We added qualifiers everywhere: "Based on visual analysis alone..." "This is not a diagnosis..." "Always consult a healthcare provider..."

We also built the severity scoring to deliberately err toward caution. If the system is uncertain, it escalates. A false alarm costs someone an unnecessary clinic visit. A missed infection could cost them a limb. Given that asymmetry, we tuned every threshold to favor sensitivity over specificity. The system would rather say "get this checked" unnecessarily than say "it's fine" incorrectly.

This design philosophy — "When in doubt, escalate" — is the opposite of how most diagnostic AI is built, and it required constant vigilance against creeping toward diagnostic language.

  1. Skin tone diversity in wound imaging Early testing revealed that our initial RGB-based tissue classification performed poorly on darker skin tones, misclassifying healthy peri-wound skin as inflamed tissue. We switched to LAB color space, which separates luminance (L channel) from color information (A and B channels), making analysis far more invariant to skin tone. We also implemented peri-wound vs. distant-skin comparison for erythema detection, rather than using absolute thresholds. This was a critical lesson in building medical AI that serves everyone.

  2. Reference object detection in real-world conditions Users don't always place a clean, well-lit coin next to their wound. Coins are dirty, worn, partially obscured, or photographed at angles. Our Hough Circle detector failed on approximately 40% of test images. We added an ArUco marker option (printable fiducial markers with known dimensions) as a more robust alternative, and implemented a graceful fallback: when no reference object is detected, the system reports wound size in relative terms rather than fabricating inaccurate measurements.

  3. The "urgent" communication problem How do you tell someone their wound looks critical without causing panic? Our first recommendation messages were too clinical ("Seek immediate surgical consultation") or too alarming ("THIS IS AN EMERGENCY"). We iterated through multiple versions, studying how emergency triage systems communicate risk. The final design uses a combination of color (red), clear but calm language, specific action verbs ("Seek emergency medical attention"), and contextual reassurance ("Do not delay" rather than "YOU ARE IN DANGER"). Every word was chosen carefully.

  4. Streamlit's limitations for custom UI Streamlit is powerful for rapid data apps but resists pixel-level UI control. Building the animated processing indicator with staged completions, the CSS floating illustrations in the hero, and the severity gauge with needle animation required extensive st.markdown(unsafe_allow_html=True) blocks and custom JavaScript injection. We fought several layout re-render issues where animations would restart on state changes.

Accomplishments that we're proud of

. It actually works on real wound photos. This is not a demo with curated images. We tested ToxiGlow on dozens of real wound photographs from public medical datasets — diabetic ulcers, surgical site infections, pressure injuries, burns — across varied lighting conditions, skin tones, and image qualities. The segmentation holds up. The tissue classification produces clinically plausible ratios. The infection markers correlate with annotated ground truth. Building something that works outside of ideal conditions is the difference between a hackathon project and a viable tool.

  1. Zero cloud dependency for core analysis. In an era where "AI" often means "API call to a GPU cluster," ToxiGlow runs entirely locally. The 6MB MobileSAM model, the classical CV pipeline, and the rule-based assessment engine all execute on-device. This isn't just a technical achievement — it's a design decision rooted in our mission. A wound assessment tool that requires internet is useless in the rural clinics and home care settings that need it most.

  2. The tissue overlay visualization. The semi-transparent color-coded tissue map overlaid on the wound image is something we're genuinely proud of. It transforms an abstract classification problem into something visually intuitive. When a user sees their wound with red (healthy), yellow (slough), and dark (necrotic) regions highlighted, they understand their wound in a way that a text report could never convey. This visualization technique has potential beyond our project — it's a new way to communicate wound status to patients.

  3. We built a medical tool that knows its place. The most common failure mode of health AI is overclaiming — positioning a statistical model as a diagnostic authority. We are proudest of what ToxiGlow refuses to do. It refuses to say "infected." It refuses to say "healed." It refuses to output a single binary answer to a complex biological question. Every output is a nudge toward professional care, never a substitute for it. In an industry racing to replace clinicians with algorithms, we built something that makes the clinician more accessible — not less necessary. That restraint is our greatest technical and ethical achievement.

  4. The design system. We built a complete design system — "Clinical Compassion" — with a 16-color palette, spacing scale, typography hierarchy, shadow system, animation library, and accessibility standards. This isn't just cosmetic. It means the interface feels consistent, intentional, and trustworthy at every touchpoint. In a medical context, design quality directly impacts user trust and adherence to recommendations.

What we learned

  1. Classical computer vision is not dead. Before reaching for a deep learning model, we asked: "Can we solve this with math?" For tissue classification, K-means in LAB space matched or exceeded the performance of a trained classifier on our test set — with zero model weights, zero training data, and complete interpretability. For reference object detection, Hough Circles works in milliseconds. The AI industry's default is "throw a transformer at it." We learned that understanding the problem's structure often reveals simpler, more robust solutions.

  2. Medical AI carries a different kind of responsibility. Building a wound assessment tool means confronting the reality that your false negative could tell someone with a developing infection that they're "fine." Your false positive could send someone on an unnecessary, expensive, stressful trip to an emergency room. We learned to design for the failure modes — hence the tiered recommendation system (not binary infected/not-infected), the explicit disclaimer, and the decision to keep a human clinician in the loop for moderate and severe cases.

  3. The last mile of medical AI is communication, not accuracy. A perfectly accurate wound classifier that outputs "85% granulation, 15% slough, erythema positive" is useless to a worried patient with no medical training. We spent as much time on the narrative generator and recommendation language as we did on the computer vision pipeline. Translating technical findings into "The wound is healing, but there are early signs that need a doctor's attention within the next two days" — that's the real product.

  4. Streamlit can be pushed further than most people realize. Custom CSS animations, JavaScript injection for scroll-based reveals and SVG animations, component-based architecture with separate UI modules — Streamlit is often treated as a prototyping tool, but we found it capable of production-quality interfaces with enough custom code. The key learning was to treat Streamlit as the application shell and use st.components.v1.html() for the pixel-perfect interactive elements.

  5. The problem is bigger than we initially understood. We entered this project thinking about wound infection detection. Through research and conversations, we learned that the real gap isn't just detection — it's the entire care coordination pathway. A patient in a rural area doesn't just need to know their wound is infected. They need to know: How urgent is this? Can it wait until my next clinic visit? Should I spend the money on transport to the city? The tiered recommendation system emerged directly from understanding this broader context.

What's next for ToxiGlow

Phase 1: Validate the warning, not the diagnosis. We will run a clinical correlation study comparing ToxiGlow's urgency recommendations against wound care specialists' independent assessments. The goal is not diagnostic accuracy — it's answering: "When ToxiGlow says seek care within 24 hours, do clinicians agree?" If they do, we have validation. If they don't, we recalibrate.

Phase 2: Make it work offline, on any phone. Rebuild as a Progressive Web App that runs entirely on-device — no internet needed. Camera-first design. One-tap capture. Works in the rural clinics and home care settings that need it most.

Phase 3: Speak the patient's language. Add narrative generation in Spanish, Hindi, Swahili, and Arabic — languages spoken in regions with the highest wound care burden and the fewest specialists.

Phase 4: Track wounds over time. Build longitudinal tracking so a patient or caregiver can photograph the same wound every 48 hours and see a healing trajectory — improving, stalled, or deteriorating — before a crisis develops.

Phase 5: Connect to care, don't replace it. Integrate with telemedicine platforms so moderate and high-severity assessments can be routed directly to a clinician's review queue, with the annotated image and measurements attached. ToxiGlow becomes the front door to care, not a standalone verdict.

Built With

Share this project:

Updates