Project Info
Inspiration
Two months ago, our teammate Sherwin underwent surgery. His recovery required weekly physiotherapy sessions where he'd receive new exercises to perform at home. The problem? Small mistakes with catastrophic consequences. Picture this: Sherwin performs his bicep curls but doesn't realize his elbow is drifting forward. His shoulder rotates slightly during lateral raises. His back arches during shoulder presses. These aren't major failures, they're subtle form deviations that feel "close enough." But in physical therapy, "close enough" isn't good enough. The reality is brutal: Recovery times extended by weeks due to incorrect form Billions of dollars wasted on preventable extended therapy No feedback between weekly PT sessionsβyou're flying blind Patients don't know they're doing exercises wrong until their next appointment Thousands of patients make similar mistakes every single day I realized that traditional PT gives you exercises on paper, sends you home, and hopes you do them correctly. There's zero real-time feedback, zero performance tracking, and zero accountability between sessions. We needed something that meets patients where they areβat homeβand provides the professional-grade coaching they'd get in a clinic. Something that uses AI to analyze every rep, catches mistakes before they become habits, and gives doctors actual data instead of patient self-reports. PhysioLens was born from this frustration. It's the AI physical therapist I wish Sherwin had during his recovery.
What it does
PhysioLens is an AI-powered physical therapy platform that transforms your home into a professional rehabilitation clinic. Just turn on your camera, and watch the magic happen: π― For Doctors: AI-Powered Exercise Creation Type a description: "Tricep extensions for post-surgical shoulder rehabilitation" Claude AI instantly generates: Camera positioning requirements Precise angle thresholds for rep counting Step-by-step patient instructions Automated form checks PubMed research references supporting the exercise protocol Camera positioning requirements Precise angle thresholds for rep counting Step-by-step patient instructions Automated form checks PubMed research references supporting the exercise protocol Production-ready exercise configuration in 30 seconds to 5 minutes Built-in library: 5 professionally configured exercises Unlimited custom AI-generated exercises πββοΈ For Patients: Real-Time AI Coaching Dual video feed: Raw camera + AI skeleton overlay 10-second countdown with on-screen positioning guidance Automatic rep counting using biomechanical angle analysis Instant form warnings: "Elbow drifting - keep it stable!", "Using momentum - slow down!" Real-time angle display with target ranges Phase tracking: "Down" β "Up" with progress bar Target completion popup when reps reached π€ Meeting Mode: Voice-Powered Clinical Assistant Continuous voice transcription during exercise sessions Emergency detection: "My knee hurts really bad" β Instant alert with urgency score Meeting scheduling: "Let's schedule a follow-up next Tuesday at 3 PM" β Auto-captured and calendared AI-generated clinical summaries after every session: Chief complaint extraction Performance + conversation insights Patient mood assessment Compliance level tracking Follow-up recommendations Chief complaint extraction Performance + conversation insights Patient mood assessment Compliance level tracking Follow-up recommendations Advanced Session Analysis AI Performance Scoring (0-100): Weighted algorithm considering reps completed, form issues, and severity Scoring philosophy: 80-85 is excellent (perfect form is rare) Biomechanical Issue Detection (9 Categories): Tremor/Instability, Compensation Patterns, Speed Variations Range of Motion Issues, Balance Problems, Form Deviations Asymmetry Detection, Fatigue Signs, and more Click any issue β jumps to exact timestamp in video Clinical Research Integration: PubMed API: Automatic research references BrightData Web Scraping: NICE, NHS, CSP clinical guidelines Evidence-based recommendations with clickable citations Clinical Notes Dashboard AI-generated clinical summaries for every session Scheduled meetings from voice transcriptions Performance metrics tracking Complete patient records
How we built it
PhysioLens is a sophisticated full-stack application combining AI, computer vision, and clinical research: Frontend React 18 with Vite for lightning-fast development MediaPipe Pose for 33-point skeletal tracking React Router v6 for client-side routing Custom utilities for angle calculations and rep counting Real-time pose detection at 30 FPS with <50ms latency Backend FastAPI (Python 3.8+) for high-performance async API Pydantic v2 for request/response validation In-memory storage for MVP (production-ready for database migration) 12 RESTful API endpoints for exercise management, session recording, and research AI Engine Claude Sonnet 4 for exercise generation, performance analysis, and clinical summaries Structured JSON output with prompt engineering Context window management for efficient processing Multi-model approach for different use cases Research Integration PubMed API for medical research papers BrightData Web MCP with Claude Agent SDK Agentic scraping of NICE, NHS, and CSP websites Structured extraction with proper citations Voice Processing Web Speech API for browser-native transcription Real-time processing with auto-restart logic Emergency and meeting keyword detection Client-side processing for privacy Video Recording System MediaRecorder API for session recording Pose data logging (33 landmarks Γ 3D coordinates) LocalStorage for session persistence Blob creation and URL generation Rep Counting Algorithm Generic angle-based counter with phase state machine 15Β° hysteresis prevents false triggers 5-frame exponential moving average for smoothing 95%+ accuracy compared to manual counting Advanced Analysis Engine SessionAnalyzer with 9 detection modules Processes sessions 5-10x faster than real-time Smart deduplication prevents spam Issue confidence scoring and severity classification Key Technologies
Challenges we ran into
π BrightData Integration Evolution Initial Approach: Started with BrightData's Browser API for static site structures, which limited website coverage and response quality. The Breakthrough: During a sponsor panel session, BrightData recommended switching to their agentic framework with MCP tools integrated. What changed: Agentic search with Claude AI intelligently queries multiple sources MCP tools (search_engine, scrape, grep) for advanced extraction Pro Mode unlocked full tool access Context-aware medical terminology understanding Result: 9-12 high-quality clinical references per exercise vs 0-2 broken snippets before β±οΈ 10-Second Countdown Implementation MediaPipe onPoseResults callback captured stale state due to closures. React state updates didn't re-register the callback. Solution: Used useRef instead of useState for mutable values that callbacks need to access. π₯ MediaRecorder State Management Recording would sometimes stop unexpectedly or duplicate chunks. Solved with dual state tracking and safe start/stop guards. π§Ή Cleanup & Memory Leaks Memory usage climbing and camera not releasing when navigating away. Implemented comprehensive cleanup function with double-cleanup prevention. π― False Positive Form Warnings Users got spammed with warnings. Drastically increased thresholds (5x for tremor, 33% for lateral lean) and added better deduplication. β‘ AI API Rate Limits Hit Claude API rate limits during testing. Added random delays and planned request queue with exponential backoff for production. π Time Pressure Built the entire system in under 36 hours. Had to cut features like user authentication and multi-patient support to focus on core MVP. The lesson? Ship a great core experience beats shipping 10 half-broken features.
Accomplishments we're proud of
β We Actually Finished (And Shipped Early!) Completed 6 hours before the deadline All core features working end-to-end Zero critical bugs in final build Professional-grade polish π― Real Impact Potential The numbers that matter: Average PT session: $150-200 Typical patient needs: 12-24 sessions ($1,800-4,800 total) If PhysioLens reduces sessions by 20%: $360-960 saved per patient Over 10 million Americans undergo PT annually Billions of dollars wasted on preventable extended therapy If PhysioLens helps just 1,000 patients: $360,000-960,000 in healthcare savings 20,000-60,000 hours of patient time saved Countless improved quality-of-life outcomes π€ AI That Actually Works Exercise generation: ~95% success rate, 30 seconds to 5 minutes Performance analysis: Processes 5,000+ pose frames per session Clinical summaries: Structured medical note format Emergency detection: Zero false negatives, ~5% false positive rate ποΈ Engineering Excellence Smart rep counting with 95%+ accuracy Advanced analysis 5-10x faster than real-time Beautiful UX that doesn't suck Full-stack mastery across 8+ technologies π‘ We Learned From Our Mistakes The BrightData pivot showed the power of asking for sponsor help early. Went from failing static scraping to getting 10x better results with agentic framework. π Built Something We're Proud to Show Demoed to PT patients, physical therapists, and hackathon judgesβall saw real value. This could be a real business.
What we learned
π From Our Sponsors Anthropic & Claude AI: Prompt engineering is everythingβspecificity drives quality Context window management for efficient processing Function calling for structured JSON output Cost optimization strategies ($0.05-0.15 per session) Claude's medical knowledge is genuinely impressive BrightData & Web Scraping: Agentic scraping > Traditional scraping MCP gives Claude powerful extraction tools Pro Mode unlocks full capabilities 5-minute sponsor conversation > hours of documentation OpenEvidence: Healthcare data must be evidence-based, not anecdotal Every recommendation needs research citations Higher bar for medical tools than consumer apps Zingage: Understanding the patient journey is critical Healthcare products must be empathetic, not just functional Focus on emotional states patients experience Stanford TreeHacks: Hackathons are innovation accelerators Constraints drive creativity Community makes the difference Impact over perfection π οΈ Technical Skills Leveled Up Computer vision (MediaPipe, angle math, skeleton rendering) Voice processing (Web Speech API, continuous transcription) AI engineering (prompt engineering, RAG, cost optimization) Web scraping (agentic scraping, MCP tools) State management (useRef vs useState, cleanup functions) Healthcare domain (PT workflows, biomechanics, clinical notes) π‘ Product Philosophy The biggest learning: Technology is easy. Impact is hard. Start with the problem, not the tech. Talk to users. Measure what matters. Build for outcomes.
What's next
π Immediate Optimization User testing with 10-20 real PT patients Production infrastructure (PostgreSQL, authentication, cloud deployment) Security hardening (HIPAA compliance considerations) Cost optimization for scale π± Mobile App Native iOS/Android apps (80% of PT patients prefer mobile) Better camera angles and movement tracking Offline mode for exercises without internet π Multi-Provider Platform Support for multiple doctors and clinics Patient portal for progress tracking Doctor dashboard for patient management Insurance integration for reimbursement π¬ Advanced Features Exercise progression algorithms Predictive analytics for recovery timelines Integration with wearables (Apple Watch, Fitbit) Telemedicine video consultations πΌ Go-to-Market Strategy Pilot program with 3-5 local PT clinics Pricing model: $29/month per patient or clinic licensing Insurance partnerships for coverage Clinical trials for FDA clearance (if needed) The vision: Make professional-grade physical therapy accessible to everyone, everywhere. PhysioLens could save billions in healthcare costs and help millions recover faster. Acknowledgments Anthropic - Claude AI for exercise generation and analysis Google MediaPipe - Pose detection technology PubMed/NCBI - Medical research database BrightData - Web scraping infrastructure OpenEvidence - For empowering us to create innovative healthcare solutions Zingage - For supporting our journey in building impactful health technology products Stanford TreeHacks - For providing the opportunity to participate in this incredible hackathon and bring PhysioLens to life
PhysioLens : AI-Powered Physical Therapy Platform
Overview
PhysioLens is a comprehensive AI-powered physical therapy platform that combines computer vision pose detection to deliver professional-grade rehabilitation at home. The system enables doctors to assign exercises to patients, tracks exercise performance in real-time, and generates clinical summaries using AI.
Key Features
Core Capabilities
-
AI-Powered Exercise Creation: Doctors can create custom exercises by providing a description and optional image. Claude AI automatically generates:
- Camera positioning requirements (upper body, full body, lower body)
- Rep counting algorithms with angle thresholds
- Step-by-step instructions
- Form checks and safety warnings
- Clinical research references from PubMed
-
Real-Time Pose Detection: Uses MediaPipe for accurate skeletal tracking with:
- Dual video feed (raw + skeleton overlay)
- Automatic rep counting
- Form deviation detection
- Live angle measurements
-
Meeting Mode (Voice Coaching):
- Continuous voice transcription during sessions
- Automatic emergency detection with instant alerts
- Meeting/appointment scheduling detection
- AI-generated clinical summaries after sessions
-
Comprehensive Session Analysis:
- Records video + pose data for later review
- AI performance scoring (0-100)
- Detailed biomechanical analysis detecting:
- Tremor/instability
- Compensation patterns
- Speed variations
- Range of motion issues
- Form deviations
- Clinical research integration via PubMed and BrightData web scraping
π¨ββοΈ Doctor Dashboard
- Browse and assign 5 built-in exercises + unlimited custom AI-generated exercises
- Set target reps for each patient
- Create custom exercises using Claude AI
- View assigned exercises and completion status
πββοΈ Patient Interface
- View assigned exercises with instructions
- Start guided exercise sessions with:
- 10-second countdown before rep counting begins
- Real-time camera positioning guidance
- Live rep counting and angle feedback
- Optional video recording for analysis
- Review session history with AI performance insights
- Access clinical notes and scheduled meetings
Analytics & Reporting
-
Session History:
- Video playback with timestamp navigation
- AI-generated performance scores
- Detailed issue detection with severity levels
- Research references from clinical literature
-
Clinical Notes:
- AI-generated session summaries
- Patient mood and compliance tracking
- Follow-up recommendations
- Scheduled appointments
Technology Stack
Frontend
- React 18 with Vite
- React Router for navigation
- Google MediaPipe for pose detection
@mediapipe/pose- Skeletal tracking@mediapipe/camera_utils- Camera integration@mediapipe/drawing_utils- Skeleton visualization
Backend
- FastAPI (Python) - RESTful API
- Claude AI (Anthropic) - Exercise generation, analysis, and clinical summaries
- PubMed API - Medical research integration
- BrightData Web MCP - Clinical resource scraping (NICE, NHS, CSP, and more)
- Web Speech API - Voice transcription
AI Integration
- Claude Sonnet 4 for:
- Custom exercise configuration generation
- Performance analysis and scoring
- Clinical summary generation
- Emergency/meeting detection from voice
Project Structure
physiolens/
βββ backend/
β βββ main.py # FastAPI server
β βββ services/
β β βββ brightdata_service.py # Web scraping for clinical resources
β βββ requirements.txt
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β β βββ CameraPositioning.jsx
β β β βββ FormFeedback.jsx
β β β βββ References.jsx
β β β βββ ClinicalResources.jsx
β β β βββ EmergencyAlert.jsx
β β β βββ MeetingSchedulePopup.jsx
β β βββ contexts/
β β β βββ MeetingModeContext.jsx # Voice transcription state
β β βββ pages/ # Main views
β β β βββ LandingPage.jsx
β β β βββ DoctorView.jsx
β β β βββ PatientView.jsx
β β β βββ AddExercise.jsx
β β β βββ ExerciseDetail.jsx
β β β βββ ExerciseSession.jsx
β β β βββ SessionHistory.jsx
β β β βββ ClinicalNotes.jsx
β β β βββ UpcomingMeetings.jsx
β β βββ utils/ # Core algorithms
β β β βββ exerciseConfigs.js # Exercise configurations
β β β βββ repCounters.js # Rep counting logic
β β β βββ formAnalysis.js # Form checking
β β β βββ poseUtils.js # Angle calculations
β β β βββ advancedAnalysis.js # Session analysis
β β βββ styles/
β β βββ App.jsx
β βββ package.json
βββ README.md
βββ .gitignore
βββ LICENCE
Installation
Prerequisites
- Node.js 18+ and npm
- Python 3.8+
- Anthropic API Key (for Claude AI)
- BrightData API Token (optional, for clinical resource scraping)
Backend Setup
- Navigate to backend directory:
cd backend
- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt --break-system-packages
- Create
.envfile:
ANTHROPIC_API_KEY=your_claude_api_key_here
BRIGHTDATA_WS_ENDPOINT=your_brightdata_endpoint
BRIGHTDATA_API_TOKEN=your_brightdata_token_here
- Run server:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Frontend Setup
- Navigate to frontend directory:
cd frontend
- Install dependencies:
npm install
- Run development server:
npm run dev
- Open browser to
http://localhost:5173
Usage Guide
For Doctors
- Navigate to Doctor View from landing page
- Assign Exercises:
- Select up to 5 exercises from the library
- Set target reps for each exercise
- Click "Assign Exercises"
- Create Custom Exercise (optional):
- Click "Add Custom Exercise"
- Provide exercise name and detailed description
- Optionally upload an image
- Claude AI generates complete configuration (30s - 5min)
- Review generated instructions and parameters
For Patients
- Navigate to Patient View from landing page
- Review Assigned Exercises
- Start Exercise Session:
- Click on an exercise
- Review instructions
- Enable "Video Guided Session" for recording (optional)
- Click "Start Exercise Session"
- Position yourself within camera frame (guidance provided)
- 10-second countdown before rep counting begins
- Perform exercise - AI tracks reps and form
- Click "Complete Session" when done
- Review History:
- View recorded sessions
- Watch video playback
- See AI performance analysis
- Review clinical research references
Meeting Mode (Voice Coaching)
- Enable Meeting Mode on landing page
- Voice recording starts automatically
- System continuously monitors for:
- Emergency keywords β Instant alert popup
- Meeting scheduling β Auto-capture and confirm
- After session, AI generates clinical summary
- View summaries in "Clinical Notes"
Built-in Exercises
- Bicep Curls (ID: 3) - Upper body, intermediate
- Lateral Raises (ID: 5) - Upper body, beginner
- Front Raises (ID: 6) - Upper body, beginner
- Standing Leg Raises (ID: 8) - Full body, beginner
AI Analysis Features
Performance Scoring (0-100)
- Reps completed vs target
- Form quality assessment
- Issue severity weighting
- Strengths and weaknesses identification
- Actionable recommendations
Detected Issues
- Tremor/Instability: Joint shaking during movement
- Opposite Hand Support: Using non-working hand for assistance
- Compensation Patterns: Leaning, twisting, momentum use
- Speed Variations: Too fast or uncontrolled movements
- Limited Range of Motion: Not reaching full extension/flexion
- Exercise-Specific: Elbow drift, back arching, etc.
Clinical Integration
- PubMed research references
- NICE/NHS/CSP guidelines (via BrightData)
- Evidence-based recommendations
API Endpoints
Exercise Management
GET /exercises- List all exercisesPOST /assign-exercises- Assign exercises to patientGET /assigned-exercises- Get patient's assigned exercisesPOST /api/create-exercise- Create custom exercise with AI
Session Recording
POST /save-recording-session- Save completed sessionGET /recorded-sessions- List all sessionsGET /recorded-sessions/{id}- Get specific sessionPOST /api/claude-analysis- Get AI performance analysis
Meeting Mode
POST /api/meeting-mode/analyze-chunk- Real-time voice analysisPOST /api/meeting-mode/generate-summary- Generate clinical summaryPOST /api/meetings/create- Create scheduled meetingGET /api/meetings/upcoming- List upcoming meetings
Research
POST /api/research/resources- Search clinical resources
Configuration
Exercise Config Structure
{
name: "Exercise Name",
cameraType: "upper_body" | "full_body" | "lower_body",
repCounting: {
type: "angle_based",
landmarks: {
point1: POSE_LANDMARKS.SHOULDER,
point2: POSE_LANDMARKS.ELBOW,
point3: POSE_LANDMARKS.WRIST
},
thresholds: {
startAngle: 140,
endAngle: 90,
hysteresis: 15
},
phases: ["down", "up"]
},
formChecks: {
stability: {
enabled: true,
maxMovement: 0.15,
warning: "Keep your body stable"
}
}
}
Browser Compatibility
- Chrome/Edge (recommended) - Full support including voice recognition
- Firefox - Pose detection works, voice features limited
- Safari - Pose detection works, voice features not supported
Performance Notes
- Pose detection runs at ~30 FPS on modern hardware
- Rep counting has 15Β° hysteresis to prevent false triggers
- Form warnings have 8-second cooldown to avoid spam
- Video recording saves to browser localStorage (5MB limit per session)
License
MIT License - see LICENSE file for details
Acknowledgments
- Anthropic - Claude AI for exercise generation and analysis
- Google MediaPipe - Pose detection technology
- PubMed/NCBI - Medical research database
- BrightData - Web scraping infrastructure
- OpenEvidence - For empowering us to create innovative healthcare solutions
- Zingage - For supporting our journey in building impactful health technology products
- Stanford TreeHacks - For providing the opportunity to participate in this incredible hackathon and bring PhysioLens to life
Built with β€οΈ for accessible, AI-powered physical therapy
Analysis
View
Metric
- 11
- 5
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
7 of 7 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
378 KB
Source files
43
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
sherwinvishesh/PhysioLens
56 files Β· 1.9 MB Β· @ ab852af
Structure
Interface
27 files Β· 48%Screens, components and styles rendered to the user.
Application logic
13 files Β· 23%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here β open the file browser to check anything the diagram implies.
Languages
- JavaScript61%
- CSS25%
- Python11%
- Markdown3%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
frontend/package.json
npm Β· 11- @mediapipe/camera_utils
- @mediapipe/drawing_utils
- @mediapipe/pose
- @mediapipe/tasks-vision
- react
- react-dom
- react-router-dom
- +4 more
backend/requirements.txt
pypi Β· 9- anthropic
- claude-agent-sdk
- fastapi
- httpx
- playwright
- pydantic
- python-dotenv
- python-multipart
- uvicorn[standard]
Declared in the repositoryβs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectβs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.