{"id":25323903,"url":"https://github.com/galihru/MentalHealth","last_synced_at":"2025-12-30T01:24:15.604Z","repository":{"id":275750275,"uuid":"926970941","full_name":"4211421036/MentalHealth","owner":"4211421036","description":"A comprehensive mental health monitoring application using modern web technologies.","archived":false,"fork":false,"pushed_at":"2025-04-01T17:33:00.000Z","size":26951,"stargazers_count":11,"open_issues_count":13,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T17:34:13.758Z","etag":null,"topics":["ai","android-application","arduino-ide","deep-learning","esp32","mechine-learing","mental-health","webapp"],"latest_commit_sha":null,"homepage":"https://4211421036.github.io/MentalHealth/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4211421036.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-04T07:13:31.000Z","updated_at":"2025-04-01T17:33:03.000Z","dependencies_parsed_at":"2025-02-04T12:22:38.671Z","dependency_job_id":"2a494ba8-9646-4cf9-8839-e7d995ced532","html_url":"https://github.com/4211421036/MentalHealth","commit_stats":null,"previous_names":["4211421036/mentalhealth"],"tags_count":352,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4211421036%2FMentalHealth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4211421036%2FMentalHealth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4211421036%2FMentalHealth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4211421036%2FMentalHealth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4211421036","download_url":"https://codeload.github.com/4211421036/MentalHealth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247749976,"owners_count":20989712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","android-application","arduino-ide","deep-learning","esp32","mechine-learing","mental-health","webapp"],"created_at":"2025-02-14T00:54:53.266Z","updated_at":"2025-12-30T01:24:15.598Z","avatar_url":"https://github.com/4211421036.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mental Health Application Based Face Recognition\n\n## Key Features:\n- **Emotion Detection**: Analyzes user's facial expressions to identify emotions.\n- **Personalized Recommendations**: Provides suggestions based on the user's emotional state.\n- **Professional Integration**: Notifications to contact mental health professionals if needed.\n\n## Formulation\n1. **Hash Function (djb2Hash)**\n\nThe hash function is used to generate a unique `FaceID` based on facial landmarks. The formula for the hash function is:\n\n$$\n\\text{hash} = 5381 \\\\\n\\text{for each character } i \\text{ in the string:} \\\\\n\\text{hash} = (\\text{hash} \\times 33) + \\text{charCodeAt}(i) \\\\\n\\text{return hash } \u003e\u003e 0 \\text{(unsigned 32-bit integer)}\n$$\n\n2. **Lip Stretch Calculation (Happiness)**\n\nThe lip stretch is calculated using the Euclidean distance between the left and right lip corners:\n\n$$\n\\text{lipStretch} = \\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\n$$\n\n3. **Cheek Raise Calculation (Happiness)**\n\nThe cheek raise is calculated as the vertical distance between the cheek and eye landmarks:\n\n$$\n\\text{cheekRaise} = y_{\\text{eye}} - y_{\\text{cheek}}\n$$\n\n4. **Lip Depression Calculation (Sadness)**\n\nThe lip depression is calculated as the vertical distance between the lip corner and the bottom lip:\n\n$$\n\\text{lipDepression} = y_{\\text{bottomLip}} - y_{\\text{lipCorner}}\n$$\n\n5. **Brow Lowering Calculation (Anger)**\n\nThe brow lowering is calculated as the vertical distance between the inner and outer brow landmarks:\n\n$$\n\\text{browLower} = y_{\\text{innerBrow}} - y_{\\text{outerBrow}}\n$$\n\n6. **Eye Openness Calculation (Surprise)**\n\nThe eye openness is calculated as the vertical distance between the eyelid and eye landmarks:\n\n$$\n\\text{eyeOpenness} = y_{\\text{eye}} - y_{\\text{eyelid}}\n$$\n\n7. **Jaw Drop Calculation (Surprise)**\n\nThe jaw drop is calculated as the vertical distance between the chin and nose landmarks:\n\n$$\n\\text{jawDrop} = y_{\\text{chin}} - y_{\\text{nose}}\n$$\n\n8. **Deviation from Neutral (Neutral Emotion)**\n\nThe deviation from neutral is calculated as the sum of Euclidean distances between key facial landmarks:\n\n$$\n\\text{deviation} = \\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\n$$\n\nThe total deviation from neutral is calculated as the sum of Euclidean distances between key facial landmarks:\n\n$$\n\\text{deviation} = \\sum_{i=1}^{n} \\sqrt{(x_{2i} - x_{1i})^2 + (y_{2i} - y_{1i})^2}\n$$\n\n## Technologies:\n- Face Recognition\n- Emotion Detection\n- Voice Analysis\n- IoT with Health Sensor (e.g., GSR Sensor, MAX30102 Sensor, BH1750 Sensor, and ESP32 Microcontroller)\n- Machine Learning\n\n## Usage:\n1. Open the application and allow camera and microphone access.\n2. Let the application analyze your facial expressions.\n3. Receive tailored recommendations based on your condition.\n\n## How To Use this Package\nYou can copy the command line below:\n\n```bash\nnpm install -g @galihridhoutomo/mentalhealth\n```\n\n### Import Modules into Project\nIf using `CommonJS`:\n\n```js\nconst EmotionDetection = require('@galihridhoutomo/mentalhealth');\n```\n\nor If using `ES Module (ESM)`:\n\n```js\nimport EmotionDetection from '@galihridhoutomo/mentalhealth';\n```\n\n### Detecting Emotion from Face Images\nUse the `detectEmotion(imagePath)` function to detect emotions from facial images:\n\n```js\nEmotionDetection.detectEmotion('path/to/image.jpg')\n.then(result =\u003e {\n  console.log('Emotion Detection Result:', result);\n})\n.catch(error =\u003e {\n  console.error('Error:', error);\n});\n```\n\nSample Output:\n\n```json\n{\n  \"emotion\": \"happy\",\n  \"confidence\": 0.92\n}\n```\n\n### Detecting Emotion from Camera in Real-Time\nIf you want to detect emotions from the camera, use the `detectEmotionLive()` function:\n\n```js\nEmotionDetection.detectEmotionLive()\n.then(result =\u003e {\n  console.log('Detected Emotion:', result);\n})\n.catch(error =\u003e {\n  console.error('Error:', error);\n});\n```\n\n### Additional Configuration (Optional)\nYou can customize the detection model with the following options:\n\n```js\nconst options = {\n  model: 'advanced',  # Can be 'basic' or 'advanced'\n  threshold: 0.8      # Minimum confidence threshold\n};\n\nEmotionDetection.detectEmotion('path/to/image.jpg', options)\n  .then(result =\u003e console.log(result))\n  .catch(error =\u003e console.error(error));\n```\n\n## Cite\nIf you are using this GitHub Repository, please cite it in the following format:\n\n```bibtex\n@misc{mentalhealth-app,\n  author = {Utomo, Galih Ridho and Maulida, Ana},\n  title = {Mental Health Application with Face Recognition and Emotion Detection},\n  year = {2025},\n  howpublished = {\\url{https://github.com/4211421036/MentalHealth}},\n  note = {GitHub repository},\n}\n```\n\n## Authors\n1. Galih Ridho Utomo\n2. Ana Maulida\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalihru%2FMentalHealth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalihru%2FMentalHealth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalihru%2FMentalHealth/lists"}