Inspiration

Maternal health complications are still a leading cause of preventable death, especially where regular specialist care is hard to access. We wanted to blend AI and empathy to build a companion that quietly watches over pregnancy in the background—spotting early warning signs, nudging people to seek help, and keeping doctors informed. CareBloom grew from the idea that timely, understandable information and simple alerts can turn anxiety into action and potentially save lives.

What it does

CareBloom is an AI-powered maternal health assistant that:

Collects key clinical inputs (age, blood pressure, blood sugar, heart rate, etc.) and predicts overall pregnancy risk as Low, Medium, or High. If the case is High risk, automatically runs a second model that screens for Pre-eclampsia and returns both a risk category and probability. Generates a personalized, structured care plan (diet tips, rest and hydration guidance, and checkup reminders) using a large language model. Offers an AI Care Assistant that explains results or answers questions in either patient-friendly or doctor-focused language. Sends optional WhatsApp alerts via Twilio to patients or doctors with concise summaries of the latest assessment.

How we built it

Data & Models: We used Kaggle datasets for maternal health risk and Pre-eclampsia. Model A (XGBoost) predicts general pregnancy risk; Model B (Random Forest) predicts Pre-eclampsia risk and probability. Models and scalers are trained in notebooks and saved with Joblib. Backend: A FastAPI service loads both models, handles feature preprocessing, orchestrates the two-step prediction pipeline, exposes /api/predict, /api/chat, /api/send_alert, and integrates with Groq for advice and Twilio for WhatsApp alerts. Frontend: A React + Tailwind UI (deployed on Vercel) collects inputs, displays risk results and probabilities, shows AI-generated care plans, and lets users trigger WhatsApp alerts. AI Assistant: The Groq API (LLaMA 3.1 8B Instant) powers two modes—short advice and structured care plans—using carefully designed prompts and JSON schemas. Deployment: The backend runs on Render; the frontend on Vercel, with CORS configured so both work together seamlessly.

Challenges we ran into

Designing a clean multi-model pipeline where the second model activates only when the first marks a case as High risk, while keeping the API simple for the frontend. Matching frontend inputs to exactly the right feature names and formats (e.g., units, ordering) expected by each trained model and scaler. Handling deployment issues like CORS, environment variables, and model file loading on Render. Managing Twilio’s WhatsApp sandbox flow, phone number normalization, and making error handling robust when credentials or connectivity are missing. Prompt‑engineering Groq so that advice is safe, empathetic, and structured (valid JSON) without sounding overly technical or like a chatbot.

Accomplishments that we’re proud of

Built an end-to-end dual-model system that predicts both general pregnancy risk and Pre-eclampsia risk with strong accuracy. Successfully combined traditional ML with an LLM to deliver both hard numbers (risk scores) and soft guidance (care plans and explanations). Integrated real-time WhatsApp alerts that can notify patients or doctors with a single click, using appropriate language for each. Created a clean, approachable UI that patients and clinicians can both understand at a glance. Deployed a fully working web app where data flows from form input to models, to AI assistant, to WhatsApp notifications in one coherent experience.

What we learned

How to architect and productionize a multi-model pipeline, turning notebook experiments into a stable, callable service. The importance of careful feature engineering and consistent preprocessing between training and inference, especially when multiple models share or extend the same inputs. Practical lessons in integrating third-party APIs (Groq, Twilio) reliably—handling failures, timeouts, and missing credentials gracefully. How critical wording is in healthcare: translating model outputs into clear, non‑alarming advice for patients while still being informative for doctors.

What’s next for CareBloom

Expanding beyond Pre-eclampsia to screen for additional pregnancy-related conditions like gestational diabetes, anemia, and infections. Adding user accounts and longitudinal tracking so patients and doctors can follow trends across multiple visits. Supporting multiple languages and localized recommendations to make CareBloom more inclusive globally. Building a mobile app with offline-friendly features and push notifications for reminders and alerts. Exploring integrations with hospital systems or electronic health records to fit more naturally into clinical workflows.

Built With

Share this project:

Updates