HealthLens AI is a wellness monitoring tool designed to track heart rate (HR), heart rate variability (HRV), and respiratory rate (RR) using remote photoplethysmogram (rPPG) and artificial intelligence (AI). The project aims to provide a non-invasive, accurate, and real-time analysis of vital signs through just a webcam or mobile camera.
HealthLens AI aims to create a wellness solution that helps individuals monitor their health metrics in a simple and user-friendly manner. By leveraging AI algorithms and rPPG technology, the tool will analyze user's vital signs and provide insights on their health status.
For a detailed project overview and introduction, please refer to the Project Overview.
- Heart Rate (HR) Monitoring: Real-time heart rate measurement.
- Heart Rate Variability (HRV) Calculation: Monitor HRV for stress and overall health.
- Respiratory Rate (RR): Track the rate of breaths per minute.
- Chatbot Integration: Provides health tips and advice based on collected data.
- Data Privacy & Security: Adheres to best practices in data handling and user privacy.
-
Frontend:
- Next.js (React-based framework)
- Tailwind CSS (Utility-first CSS framework)
- TypeScript (JavaScript with static types)
-
Backend:
- FastAPI (Asynchronous Python web framework)
- Python 3.10+
- PostgreSQL (For database management, using Docker or Supabase)
-
AI & Data Processing:
- rPPG (remote photoplethysmography) for non-invasive heart rate monitoring
- Gemini 2.5 Flash API (Google) for AI chatbot responses
- OpenCV and MediaPipe for video capture and signal processing
-
Security & Authentication:
- JWT Authentication for secure user login
- OAuth2 for third-party authentication options
Follow the instructions below to set up the project locally.
Ensure you have the following installed:
- Node.js (for frontend)
- Python 3.10+ (for backend)
- PostgreSQL or a Supabase account for database management.
git clone https://github.com/YOUR_USERNAME/HealthLensAI.git
cd HealthLensAI- Navigate to the frontend directory and install dependencies:
cd healthlens-frontend
npm install- Configure Tailwind CSS:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init- Install ESLint and Prettier for code formatting:
npm install eslint prettier eslint-config-prettier eslint-plugin-prettier --save-dev- Run the frontend:
npm run dev- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Linux/Mac
.\venv\Scripts\activate # On Windows- Install the required dependencies:
pip install fastapi uvicorn opencv-python mediapipe numpy scipy pandas scikit-learn sqlalchemy psycopg2-binary python-jose[cryptography] passlib[bcrypt]- Run the backend server:
uvicorn app.main:app --reload- Using Docker Compose:
If you prefer local development, set up PostgreSQL with Docker. Create a
docker-compose.ymlfile with the following content:
version: '3.8'
services:
db:
image: postgres:13
environment:
POSTGRES_DB: healthlens
POSTGRES_USER: healthlens_user
POSTGRES_PASSWORD: password
ports:
- "5432:5432"then, run the following command:
docker-compose up -d- Using Supabase:
- Create an account on Supabase and
- Follow the instructions to set up a PostgreSQL database and note down your database connection details (host, database, username, password).
- You can use these credentials to configure the PostgreSQL connection in your backend.
- Obtain a Gemini API key to enable AI chatbot functionality:
- Go to Google AI Studio to generate a free Gemini API key.
- Once you have your API key, store it in the
.env.localfile at the root of the frontend project:
GEMINI_API_KEY=your_api_key_here
- Set the API key in your environment variables.
- Make sure to load this key in your Next.js backend route (
/api/chat) viaprocess.env.GEMINI_API_KEY. - Never commit your
.env.localfile — it is already excluded via.gitignore.
To contribute to the project, fork the repository and create a pull request with your changes. Please follow the following steps:
- Fork the repository on GitHub.
- Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/HealthLensAI.git- Create a new branch for your changes:
git checkout -b feature-branch-name- Push changes to your fork:
git push origin feature-branch-name- Create a pull request on GitHub.
- Wellness Tool, Not Medical Device: This tool is designed for wellness monitoring, not for diagnosing medical conditions.
- Privacy-First: User data is handled with strict privacy in mind. No raw video is stored, and all data is encrypted and anonymized.
- Safety-First: All health-related advice is provided with disclaimers. The AI chatbot offers general tips and encourages users to consult medical professionals for serious concerns.
- Transparency: All health metrics are presented with confidence scores to ensure the user understands the quality of the data being presented.
- Encryption and Data Handling:
- All sensitive data, including health metrics, will be encrypted both in transit (using SSL/TLS) and at rest (using AES-256 encryption).
- Health data such as heart rate, HRV, and RR will be anonymized and stored only after processing. Raw video footage will never be stored.
- Data Anonymization:
- Personal identifiable information (PII) will be removed wherever possible from the stored data, ensuring that the system complies with data protection regulations (e.g., GDPR).
- User Consent:
- Before any data is collected, the user will be required to give explicit consent regarding how their data will be collected, processed, stored, and used. The system will provide clear information on what data is being collected and why.
This project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions to HealthLens AI! Please fork the repository and submit pull requests for bug fixes, improvements, or new features.
- BP Estimation (Phase 5): Integrating blood pressure estimation and calibration.
- Mobile Version: Developing a mobile app using React Native or PWA.
- Enhanced Chatbot Features: Adding more personalized health advice based on user data.
- rPPG (remote Photoplethysmography): A technology used to measure physiological signals (such as heart rate) by analyzing subtle changes in skin color due to blood flow, captured through a device's camera (smartphone or laptop).
- HR (Heart Rate): The number of heartbeats per minute.
- HRV (Heart Rate Variability): The variation in the time interval between heartbeats, a key indicator of stress levels and overall health.
- RR (Respiratory Rate): The number of breaths per minute.
- AI (Artificial Intelligence): A technology that enables the system to automatically analyze data and provide health recommendations based on the collected data.
- MVP (Minimum Viable Product): The first version of the product with just enough features to test the market and gather user feedback.
- BP (Blood Pressure): The measurement of the force exerted by blood against the walls of arteries.
- API (Application Programming Interface): A set of rules that allow different software applications to communicate with each other.
- JWT (JSON Web Token): An open standard for securely exchanging information between systems via tokens (authentication tokens).
| Acronym | Meaning |
|---|---|
| rPPG | Remote Photoplethysmography |
| HR | Heart Rate |
| HRV | Heart Rate Variability |
| RR | Respiratory Rate |
| AI | Artificial Intelligence |
| MVP | Minimum Viable Product |
| BP | Blood Pressure |
| API | Application Programming Interface |
| JWT | JSON Web Token |