Update README.md
Browse files
README.md
CHANGED
@@ -7,92 +7,137 @@ tags:
|
|
7 |
- mental_health
|
8 |
---
|
9 |
|
|
|
10 |
---
|
11 |
|
12 |
-
# Facial Expression and Mental Health Counseling AI
|
13 |
|
14 |
[![Hugging Face](https://img.shields.io/badge/Model-Hugging%20Face-blue)](https://huggingface.co/LOHAMEIT/BITShyd)
|
15 |
|
16 |
-
### Project
|
|
|
|
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
- **Real-time Emotion Recognition** from facial expressions
|
22 |
-
- **Contextually Relevant Responses** in a supportive, conversational tone
|
23 |
|
24 |
-
|
25 |
|
26 |
-
- **Model Type**: Conversational AI with
|
27 |
-
- **
|
28 |
-
- **Fine-Tuning
|
29 |
-
- **
|
30 |
|
31 |
---
|
32 |
|
33 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
|
36 |
```python
|
37 |
-
from transformers import
|
38 |
|
39 |
tokenizer = AutoTokenizer.from_pretrained("LOHAMEIT/BITShyd")
|
40 |
model = AutoModelForCausalLM.from_pretrained("LOHAMEIT/BITShyd")
|
41 |
```
|
42 |
|
43 |
-
|
44 |
-
-
|
45 |
-
-
|
46 |
|
47 |
-
|
48 |
```python
|
49 |
-
|
50 |
-
|
|
|
51 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
52 |
```
|
53 |
|
54 |
---
|
55 |
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
- **Unsloth** minimizes latency and optimizes response generation, improving the model's suitability for real-time applications.
|
62 |
|
63 |
-
|
64 |
-
```bash
|
65 |
-
pip install lora unsloth
|
66 |
-
```
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
from lora import LoraTrainer
|
71 |
-
trainer = LoraTrainer(model, dataset="Amod/mental_health_counseling_conversations")
|
72 |
-
trainer.train()
|
73 |
-
```
|
74 |
|
75 |
-
|
76 |
|
77 |
-
| Parameter | Description
|
78 |
-
|
79 |
-
| Model Size | 8 Billion Parameters
|
80 |
-
|
|
|
|
|
|
81 |
| Dataset | Amod/mental_health_counseling_conversations |
|
82 |
-
|
|
83 |
|
84 |
-
|
|
|
|
|
85 |
|
86 |
-
|
|
|
|
|
87 |
|
88 |
---
|
89 |
|
90 |
## License
|
91 |
|
92 |
-
This model
|
93 |
|
94 |
---
|
95 |
|
96 |
-
Explore the
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
-
---
|
|
|
7 |
- mental_health
|
8 |
---
|
9 |
|
10 |
+
---
|
11 |
---
|
12 |
|
13 |
+
# BITShyd: Facial Expression and Mental Health Counseling AI
|
14 |
|
15 |
[![Hugging Face](https://img.shields.io/badge/Model-Hugging%20Face-blue)](https://huggingface.co/LOHAMEIT/BITShyd)
|
16 |
|
17 |
+
### Project Summary
|
18 |
+
|
19 |
+
**BITShyd** is an advanced AI model that combines **facial expression recognition** with **mental health counseling dialogues**, designed to offer empathetic responses based on both visual and conversational cues. This project fine-tunes a conversational AI with the **Amod/mental_health_counseling_conversations** dataset, adapting it specifically for virtual counseling and emotional support applications.
|
20 |
|
21 |
+
The model leverages LoRA (Low-Rank Adaptation) and Unsloth fine-tuning techniques for efficient adaptation, making it suitable for use on various hardware setups, from personal devices to cloud-based applications.
|
22 |
|
23 |
+
---
|
|
|
|
|
24 |
|
25 |
+
## Model Details
|
26 |
|
27 |
+
- **Model Type**: Conversational AI with emotional intelligence features
|
28 |
+
- **Dataset**: [Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations)
|
29 |
+
- **Fine-Tuning Methods**: LoRA & Unsloth for optimized performance and low latency
|
30 |
+
- **Primary Applications**: Virtual mental health support, empathetic AI assistants, interactive emotional response models
|
31 |
|
32 |
---
|
33 |
|
34 |
+
## Key Features
|
35 |
+
|
36 |
+
- **Real-Time Facial Expression Recognition**: Capable of identifying emotional expressions such as happiness, sadness, anger, surprise, and neutrality.
|
37 |
+
- **Empathetic, Contextually Aware Responses**: Trained specifically for counseling-based responses, this model interacts in an emotionally supportive way.
|
38 |
+
- **Scalable Fine-Tuning Techniques**: LoRA and Unsloth allow for efficient, resource-light tuning, making the model adaptable to different devices.
|
39 |
+
|
40 |
+
---
|
41 |
+
|
42 |
+
## Quickstart Guide
|
43 |
+
|
44 |
+
Here’s how to get started with using this model in your own applications.
|
45 |
+
|
46 |
+
### Installation and Setup
|
47 |
+
|
48 |
+
1. **Install Hugging Face Transformers and Required Libraries**:
|
49 |
+
```bash
|
50 |
+
pip install transformers torch
|
51 |
+
```
|
52 |
|
53 |
+
2. **Load the Model and Tokenizer**
|
54 |
```python
|
55 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
56 |
|
57 |
tokenizer = AutoTokenizer.from_pretrained("LOHAMEIT/BITShyd")
|
58 |
model = AutoModelForCausalLM.from_pretrained("LOHAMEIT/BITShyd")
|
59 |
```
|
60 |
|
61 |
+
3. **Preparing Input**
|
62 |
+
- **Text Input**: This model uses text prompts, ideally incorporating facial expression indicators for contextual awareness.
|
63 |
+
- **Image Input** (Optional): For real-time interaction, integrate with a facial expression API to enhance response generation based on user expressions.
|
64 |
|
65 |
+
4. **Generate a Response**
|
66 |
```python
|
67 |
+
input_text = "Hello, I feel anxious today."
|
68 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
69 |
+
output = model.generate(**inputs, max_length=50)
|
70 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
71 |
```
|
72 |
|
73 |
---
|
74 |
|
75 |
+
## Usage Examples
|
76 |
+
|
77 |
+
### 1. Mental Health Support Assistant
|
78 |
+
```python
|
79 |
+
input_text = "I'm feeling overwhelmed and don't know how to manage my stress."
|
80 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
81 |
+
output = model.generate(**inputs, max_length=50)
|
82 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
83 |
+
```
|
84 |
+
Expected Response:
|
85 |
+
> "I'm here for you. It sounds like things are challenging right now. Let's take a deep breath together. Would you like to talk more about what's overwhelming you?"
|
86 |
+
|
87 |
+
### 2. Emotionally Responsive AI Assistant
|
88 |
+
This example integrates with a facial expression API to adjust responses based on detected emotions (like sadness or happiness).
|
89 |
+
|
90 |
+
```python
|
91 |
+
detected_emotion = "sadness" # Detected through facial expression analysis
|
92 |
+
input_text = "I've been feeling lonely lately."
|
93 |
+
inputs = tokenizer(f"{detected_emotion} | {input_text}", return_tensors="pt")
|
94 |
+
output = model.generate(**inputs, max_length=50)
|
95 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
96 |
+
```
|
97 |
+
Expected Response:
|
98 |
+
> "I'm sorry you're feeling this way. Loneliness can be really tough. Sometimes sharing your feelings can help. I'm here to listen if you'd like to talk."
|
99 |
|
100 |
+
---
|
101 |
|
102 |
+
## Model Training and Fine-Tuning Details
|
|
|
103 |
|
104 |
+
This model was trained with **LoRA** and **Unsloth**:
|
|
|
|
|
|
|
105 |
|
106 |
+
- **LoRA (Low-Rank Adaptation)**: LoRA enables the model to retain core knowledge while adapting efficiently to new data, making it ideal for nuanced tasks like mental health counseling.
|
107 |
+
- **Unsloth**: Unsloth enhances inference speed, allowing the model to process requests with lower latency, suitable for real-time interaction scenarios.
|
|
|
|
|
|
|
|
|
108 |
|
109 |
+
Training Configurations:
|
110 |
|
111 |
+
| Parameter | Description |
|
112 |
+
|-----------------|-------------------------------------|
|
113 |
+
| Model Size | 8 Billion Parameters |
|
114 |
+
| Epochs | 3 |
|
115 |
+
| Learning Rate | 5e-5 |
|
116 |
+
| Batch Size | 8 |
|
117 |
| Dataset | Amod/mental_health_counseling_conversations |
|
118 |
+
| Optimizations | LoRA and Unsloth |
|
119 |
|
120 |
+
---
|
121 |
+
|
122 |
+
## Future Work
|
123 |
|
124 |
+
- **Advanced Emotion Detection**: Plan to integrate a broader range of emotions and body language cues.
|
125 |
+
- **Interactive Widgets**: Adding Hugging Face widget for real-time interactions directly on this model’s page.
|
126 |
+
- **Deployment Options**: Explore integration with cloud-based platforms for widespread access.
|
127 |
|
128 |
---
|
129 |
|
130 |
## License
|
131 |
|
132 |
+
This model is available under the Apache 2.0 License. For detailed terms, refer to the [LICENSE](LICENSE.md) file in the repository.
|
133 |
|
134 |
---
|
135 |
|
136 |
+
### Explore the Model
|
137 |
+
|
138 |
+
Interact with the model here: [LOHAMEIT/BITShyd](https://huggingface.co/LOHAMEIT/BITShyd)
|
139 |
+
|
140 |
+
For any feedback or collaboration requests, feel free to reach out on Hugging Face or GitHub!
|
141 |
+
|
142 |
+
---
|
143 |
|
|