Alison Kohout Food–Body Connection

Food–Body Connection

ICON

Food–Body Connection is a full‑stack health analytics application designed to help users identify potential food or environmental allergens associated with adverse symptoms. Users log exposures and symptoms over time, and the system applies statistical analysis

The goal is decision support — not diagnosis. The application highlights candidate trigger foods to investigate further and provides structured insights that can be discussed with healthcare professionals.

What the app does

  • Logs allergen exposure events with quantities and timestamps
  • Logs symptom events with severity and timing
  • Allows logged entries to be reviewed, edited, or deleted after the fact
  • Tracks twice-daily check-ins covering mood, sleep, fatigue, gut health, stress, and more
  • Logs medications and active regimens with dose and date tracking
  • Prescribes and logs strength training sessions, adjusting load to logged symptoms
  • Accepts uploaded health documents (PDF, DOCX, text) for contextual AI analysis
  • Stores structured health data in a relational PostgreSQL database with field-level encryption
  • Aligns exposure and symptom events using time‑aware windows
  • Analyzes relationships between allergens and symptoms
  • Generates personalized AI-powered reports highlighting potential trigger foods
  • Supports elimination diets and long‑term tracking strategies
  • Installable as a Progressive Web App for offline access

Statistical & machine‑learning analysis

The system is designed for real‑world health data: frequent exposures, rare symptoms, delayed responses, and small sample sizes. Models prioritize interpretability and robustness over raw predictive power.

Logistic Regression

  • Estimates the probability that an allergen is associated with symptom occurrence
  • Produces interpretable odds ratios for each allergen
  • Uses regularization and class weighting to handle imbalance
  • Evaluated using ROC AUC, symptom recall, and bootstrapped confidence intervals

Fisher Exact Test

  • Exact statistical test for association in small or sparse datasets
  • Confirms associations suggested by regression models
  • Reports p‑values for allergen–symptom relationships

Ordinal Logistic Regression (Dose–Response)

  • Models the relationship between exposure volume and symptom severity
  • Preserves ordinal symptom intensity information
  • Produces odds ratios with confidence intervals for exposure dose
  • Supports sensitivity analysis across different post‑exposure time windows

Cyclical Headache Forecast

  • Estimates the probability of a symptom day for each day of a recurring cycle
  • Uses the empirical per-cycle-day hit rate across all completed cycles
  • Smooths circularly across adjacent cycle days, since a handful of cycles makes any single day far too noisy
  • Projects forward as three coarse likelihood bands — enough to rank days, not to quote a percentage

Medication Change Analysis

  • Rebuilds total daily dose as a step function to locate the points where it changed
  • Compares symptom rates in equal-length windows before and after a change
  • Reports a rate ratio with an exact Poisson confidence interval
  • Observational and uncontrolled — the plot states plainly that it shows no causation

AI‑Powered Summary & Chat

  • Generates natural‑language health summaries using Claude (Anthropic API)
  • Provides a conversational chat interface grounded in the user's own tracking data
  • Queries logged training sets and aggregates training volume through structured tool calls
  • Incorporates uploaded health documents as additional context for responses
  • Clearly scoped to data interpretation — not medical diagnosis

Technology stack

The application is deployed as a cloud‑based system with a static frontend and a secure API backend.

  • Backend: FastAPI (Python)
  • Database: PostgreSQL on NEON
  • ORM: SQLAlchemy
  • Authentication: JWT‑based authentication with password reset flow
  • AI: Claude (Anthropic API) for health summaries and chat
  • Analysis: Statistical modeling and supervised machine learning
  • Data security: Field-level encryption on all sensitive health data
  • Frontend: Static Progressive Web App hosted on GitHub Pages

System architecture

Static Frontend (GitHub Pages) → HTTPS (JWT‑authenticated API calls) → FastAPI Backend (Oracle) → PostgreSQL Database (NEON)

The backend exposes REST endpoints for data logging, triggering analyses, and returning metrics and plots for visualization.

Database design

The relational schema tracks users, allergens, symptoms, exposure events, symptom events, medications, check-ins, training sessions, and uploaded documents over time. All timestamps are stored in UTC, sensitive fields are encrypted at rest, and all health data is scoped per user.

  • Users: Account and authentication data
  • Allergens: User‑defined exposure categories
  • Units: Measurement units and conversions
  • Allergen logs: Timestamped exposure events
  • Symptoms: User‑defined symptom definitions with optional grouping
  • Symptom logs: Timestamped symptom events with severity
  • Medications: User‑defined medication names
  • Medication regimens: Dose, unit, and active date range per medication
  • Daily check-ins: Twice-daily structured wellbeing records (morning / evening)
  • Exercises: Per-user exercise library with equipment, target area, and form cues
  • Workout sessions: Dated training sessions with duration, RPE, and a morning-after soreness score
  • Set logs: Individual sets with reps, load, band, hold time, side, RPE, and pain
  • Training profile: Programme selection, goals, constraints, and owned equipment
  • Practice items: User-defined routines that bookend each session
  • User documents: Uploaded health documents with extracted text for AI context
  • Password reset tokens: Secure, expiring tokens for account recovery

Daily check-ins & wellbeing tracking

Users complete structured morning and evening check-ins to build a continuous picture of their wellbeing alongside allergen and symptom data.

  • General variables: mood, sleep quality, fatigue, gut health, stress
  • Extended variables: headache, overnight headache, brain fog, tinnitus, visual disturbance, training intensity, illness status
  • Check-in trends are visualized over time and can be cross-referenced with allergen and symptom events
  • Medication and check-in data can both be included in the unified time series view

Training programme

The training feature turns the same health record into a prescriptive strength programme. It decides what to train today, what load to use, and when to hold back — reading the symptoms and check-ins already logged elsewhere in the app.

The progression rules are deterministic by design. A rule that reads the previous session's morning-after soreness score and refuses to add load is a guarantee; the same instruction written into a prompt is only a suggestion. The AI layer explains the plan and answers questions about it — it does not choose loads.

Programmes and phases

  • Selectable programmes, each with their own exercises, session themes, and baseline tests
  • Three progressive phases per programme, from tolerance work through to heavier loading
  • Advancement requires both time in the phase and quiet symptoms, so a good week cannot promote someone whose joints are complaining
  • Rotating A/B/C session days, so every area is trained two or three times a week rather than once
  • A submaximal baseline assessment sets starting loads, holds, and rep targets — no one-rep maxes
  • User-defined practice routines bookend each session, separate from the programme itself

How a session is prescribed

  • Double progression: reps or hold time build to the top of a range before load is added
  • Symptom-led back-off: load holds or drops when the morning-after score is high, and only for the body areas actually affected
  • Side-specific adjustment: on unilateral work only the sore side eases off, so the good side keeps training
  • Instability handling: standing single-leg work is dropped outright — not merely trimmed — when a joint is giving way
  • Stall detection: an exercise that fails the same target three sessions running is swapped for an easier version of the same movement
  • Equipment substitution: exercises are matched to the kit the user owns, and loads are rounded to weights that can actually be built from their plates
  • Session modes: a logged headache or fatigue suggests a reduced or gentle session — a shorter list rather than smaller numbers — which the user can override
  • Spacing: strength days are kept apart, with practice and maintenance work filling the days between

Logging and feedback

  • A guided session runner walks through each prescribed exercise in order
  • Sets record reps, weight, band resistance, hold time, side, RPE, and pain
  • Off-plan sets can be logged separately without disturbing the programme
  • A morning-after soreness score is collected the day after each session, and is what decides whether load goes up
  • Pre-session check-ins surface only the symptoms that change what the session may contain

Connection to the wider record

Training is not a separate app bolted on. Because it shares one database with the allergen, symptom, medication, and check-in logs, a symptom recorded in the morning reaches that afternoon's session, training intensity appears alongside every other check-in variable in the time series, and the AI chat can answer questions that cross the boundary — such as whether joint pain tracks training volume.

Visualizations

The dashboard renders a range of interactive and static plots generated by the backend:

  • Allergen importance ranking
  • Symptom grouping and EDA
  • Time series for allergens, symptoms, check-in variables, and medications
  • Symptom calendar heatmap
  • Check-in trend plots
  • Triptan usage and monthly analysis
  • Headache likelihood forecast calendar
  • Medication change before/after comparison
  • Risk visualizations
  • Dose–response analysis with event series overlays
  • Model performance metrics page

Limitations & caveats

  • Correlation does not imply causation
  • Confounders (stress, sleep, illness) are not yet modeled
  • Small sample sizes increase uncertainty
  • Outputs are not intended for medical diagnosis

Future development

Planned Analysis Enhancements

  • Identify and analyze recurring patterns in symptom occurrence
  • Enable analysis across user‑selected date ranges
  • Support logging of multiple allergens and symptoms within a single event

Data Management Improvements

  • Introduce a dedicated Food table with automatic allergen assignment
  • Provide access to raw data for greater transparency and control

Reporting & Sharing

  • Enable optional email delivery of generated reports

Architecture & Scalability

  • Migrate to an alternative system architecture to support long‑term growth and scalability

Try the app

The Food–Body Connection app allows users to log foods and symptoms and receive personalised analytical reports.

Launch App