Home / Domain
Domain
The research background and domain behind FITSHIELD: literature survey, research gap, problem definition, objectives, methodology, and technologies.
Literature survey
We reviewed work in four areas, one for each component.
Food and drug interactions
Clinical pharmacology has long documented that what a person eats can change how a medicine works. Familiar examples include vitamin K–rich foods and warfarin, grapefruit and some statins, and St John’s wort and drugs cleared by liver enzymes. Allergies add a second layer of risk that nutrition apps rarely check against a user’s medication list.
Supplement advice and recommendation
Supplement guidance online is mostly marketing or generic. Tree-based ensemble models such as Random Forest handle mixed numeric and categorical profile data well and give stable results on tabular datasets of the size used here. They predict effectiveness, but they do not know about drug interactions, so they need an explicit safety layer.
Pose estimation for exercise
Keypoint detectors such as PoseNet, MoveNet and BlazePose can find shoulders, elbows, hips, knees and ankles from a single camera in real time. Exercise-form research builds on this by computing joint angles and comparing them with reference ranges for each movement.
Habit formation and adaptive plans
Studies of habit formation, such as Lally et al. (2010), show that people take very different lengths of time to make a behaviour automatic. That supports plans that respond to each person’s adherence instead of following a fixed schedule.
References. The full reference list will be added here once the literature review in the proposal document is finalised.
Research gap
Most consumer tools address one concern at a time, and the concerns affect each other.
- Nutrition and supplement tools rarely check a user’s medication and allergy list before advising.
- Posture tools correct form in the moment but do not feed what they learn into the user’s routine.
- Workout plans are usually fixed. They do not respond when the user skips sessions or outgrows the plan.
- Supplement recommendations are often unscreened and ignore budget and dietary restrictions.
FITSHIELD fills this gap by connecting the components, so one component’s output becomes another’s input.
Research problem
People who exercise and use supplements decide about food, medication, supplements, exercise form and routine separately. Unsafe combinations and poor technique can cause harm. Fixed plans lead people to quit. No single, explainable system watches all four and adapts to the person.
Research question. How can one platform screen dietary and supplement safety, assess exercise posture in real time, and adapt a person’s habit plan from observed behaviour?
Proposed solution
FitShield is a personalized fitness and nutrition mobile application that integrates multiple AI-driven components into a single, user-centered platform. Each team member focuses on a complementary research component:
| Student | Component | Key Focus of Solution |
|---|---|---|
| W.M.P.G.S. Dilhara IT22169044 |
Smart Supplementary Advisory Recommendation | Personalized supplement recommendations using Random Forest ML + rule-based drug–supplement interaction detection, personalized scheduling, and cost/quality comparison features. |
| Ramanayake R.M.S.M. IT22065476 |
Health-Aware Personalized Dietary Recommendation & Safety Advisory | Personalized meal suggestions with food-allergy detection, food–drug interaction analysis, risk scoring (Safe / Moderate / Dangerous), and safer alternatives, using Sri Lankan food composition data. |
| Herath H.M.T.N. IT22248176 |
AI-based Posture Recognition + Motivational Feedback | Real-time posture analysis via mobile camera (MediaPipe / OpenPose), joint-angle evaluation, instant corrective + motivational feedback, activity/repetition tracking, and detection of repeated mistakes. |
| Gamaachchige C.D. IT22621542 |
Hybrid ML-Driven Dynamic & Localized Adaptive Profiling with Explainable Intelligence | Dynamic, evolving user profiles using hybrid ML (clustering + deep learning) + Explainable AI (SHAP/LIME). Continuously adapts to user behavior and is grounded in Sri Lankan datasets. Serves as the intelligent core for personalization across the system. |
Overall System Goals
- Deliver safe, personalized, and culturally relevant fitness + nutrition guidance.
- Detect and prevent harmful interactions (supplements, food, drugs, allergies).
- Provide real-time posture correction and motivational support to improve exercise quality and reduce injury risk.
- Maintain adaptive, transparent (explainable) user profiles that evolve with the user’s behavior.
- Improve recommendation accuracy, system usability (target SUS > 70), and long-term user engagement.
Research objectives
Main objective
Build an integrated platform that screens food and supplement safety, checks exercise posture in real time, and adapts habit plans to each user’s observed behaviour.
Specific objectives
- Diet safety. Detect food–drug interactions and allergen risks, and return a risk score with an explanation and safer alternatives.
- Supplement advisory. Rank supplements for the user’s goal by predicted effectiveness, exclude unsafe options, and match affordable products.
- Posture recognition. Estimate body pose from a live camera, measure joint angles, classify posture, and give corrective feedback instantly.
- Adaptive habit evolution. Classify the user’s habit stage and adapt difficulty, replace failing habits, and generate personal feedback.
- Integration. Share results between components through one authenticated service layer and a single dashboard.
Methodology
FITSHIELD is built as a set of small services behind one API gateway. The mobile and web app talk only to the gateway, which routes each request to the authentication, diet, supplement, exercise or habit service. Machine-learning code runs in Python and is called by the Node.js services.
Diet safety
Input: medicine name, food or drink, and the user’s allergies.
Output: model risk, rule warnings, allergy risks, a final risk score, an explanation and safer alternatives.
A trained model estimates risk, and deterministic rules add explicit warnings. Combining both keeps results explainable.
Supplement advisory
A request becomes a ranked, safety-screened recommendation in six steps.
- The user’s goal, body profile, diet, budget, medications, allergies and conditions are normalised.
- The Random Forest predicts effectiveness (Low, Medium or High) for each goal-relevant supplement, using encoders saved at training time.
- Each candidate is checked against medication interactions, allergens, vegan or vegetarian limits and health conditions.
- Products are matched from the catalogue, prices converted to LKR, and the user’s budget enforced. The top three are kept.
- A score combines effectiveness, product availability and warning severity into Recommended, Caution or Not Recommended. Hard exclusions score 0.
- The ranked result is returned, and saved to the user’s history when they are signed in.
Posture recognition
- The user starts an exercise and the camera captures live video.
- Pose estimation detects body landmarks.
- Joint angles are calculated and compared with the correct range for that exercise.
- Posture is classified as correct or incorrect.
- A cue such as “Keep your back straight” is shown straight away.
- Repetitions, posture correctness and completion are sent to the habit engine.
Adaptive habit evolution
Habit strength is the share of assigned habits the user completed:
Habit strength = completed habits ÷ total assigned habits
A Random Forest classifier then places the user in one of four stages: Initiation, Inconsistent, Stabilizing or Habitual. A rule-based adaptation engine updates the plan: lower difficulty when adherence is low, raise it when adherence is high, and replace a habit the user keeps failing.
Dashboard score
The overall health score on the dashboard is calculated from the components rather than entered by hand.
| Factor | Weight | Source |
|---|---|---|
| Exercise performance | 35% | Posture recognition |
| Habit adherence | 30% | Habit engine |
| Diet quality | 20% | Diet safety |
| Supplement compliance | 15% | Supplement advisory |
Data used
| Dataset | Records | Used for |
|---|---|---|
| Fitness and supplement profiles | 3,788 | Training the effectiveness model |
| Nutrition products | 840 | Product and price matching |
| Supplement–drug interactions | 78 | Safety rules |
| Supplement allergens | 41 | Allergen screening |
| Fitness and workout records | 2,598 | Exercise and calorie reference |
| Habit evolution records | 200 | Training the habit-stage classifier |
Technologies used
The end-to-end technological stack powering food-drug safety screening, supplement prediction, real-time computer vision, and adaptive habit evolution.
React Native & Expo
Cross-platform mobile application utilizing Expo Router for file-based navigation, high-performance UI components, and native camera hardware access.
TypeScript
End-to-end static type safety enforcing rigorous schema contracts between mobile telemetry, pharmacological models, and backend endpoints.
Node.js & Express
Non-blocking event-driven backend microservices orchestrating the API gateway, proxy middleware, and async scoring calculations.
JWT & bcrypt Security
Stateless cryptographic JWT authentication with salting via bcrypt for private athlete biometric credentials and password recovery flows.
Random Forest (scikit-learn)
Ensemble Random Forest classifier trained on 3,788 athlete records to predict supplement efficacy percentages and optimize nutrient budgets.
Pandas & NumPy
Data cleaning, feature vector engineering, categorical encoding, and mathematical transformation of multivariate training profiles.
TensorFlow.js PoseNet
Real-time edge joint tracking directly in the client browser, measuring joint flexion angles (knee, hip, spine) at 30 FPS without video upload lag.
Gemini Flash AI
High-speed server-side multimodal intelligence assisting with deep posture biomechanics reasoning, form degradation diagnosis, and corrective cues.
MongoDB & Mongoose
Scalable document-oriented datastore housing athlete accounts, dynamic habit progress histories, meal logs, and medication safety interaction rules.
Pharmacological Datasets
Curated database of 78 validated supplement-drug interaction rules, 41 allergen classifications, and 840 verified nutritional product compounds.