|
--- |
|
datasets: |
|
- Amod/mental_health_counseling_conversations |
|
base_model: |
|
- meta-llama/Llama-3.1-8B-Instruct |
|
tags: |
|
- mental_health |
|
--- |
|
|
|
--- |
|
--- |
|
|
|
# BITShyd: Facial Expression and Mental Health Counseling AI |
|
|
|
[![Hugging Face](https://img.shields.io/badge/Model-Hugging%20Face-blue)](https://huggingface.co/LOHAMEIT/BITShyd) |
|
|
|
### Project Summary |
|
|
|
**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. |
|
|
|
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. |
|
|
|
--- |
|
|
|
## Model Details |
|
|
|
- **Model Type**: Conversational AI with emotional intelligence features |
|
- **Dataset**: [Amod/mental_health_counseling_conversations](https://huggingface.co/datasets/Amod/mental_health_counseling_conversations) |
|
- **Fine-Tuning Methods**: LoRA & Unsloth for optimized performance and low latency |
|
- **Primary Applications**: Virtual mental health support, empathetic AI assistants, interactive emotional response models |
|
|
|
--- |
|
|
|
## Key Features |
|
|
|
- **Real-Time Facial Expression Recognition**: Capable of identifying emotional expressions such as happiness, sadness, anger, surprise, and neutrality. |
|
- **Empathetic, Contextually Aware Responses**: Trained specifically for counseling-based responses, this model interacts in an emotionally supportive way. |
|
- **Scalable Fine-Tuning Techniques**: LoRA and Unsloth allow for efficient, resource-light tuning, making the model adaptable to different devices. |
|
|
|
--- |
|
|
|
## Quickstart Guide |
|
|
|
Here’s how to get started with using this model in your own applications. |
|
|
|
### Installation and Setup |
|
|
|
1. **Install Hugging Face Transformers and Required Libraries**: |
|
```bash |
|
pip install transformers torch |
|
``` |
|
|
|
2. **Load the Model and Tokenizer** |
|
```python |
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("LOHAMEIT/BITShyd") |
|
model = AutoModelForCausalLM.from_pretrained("LOHAMEIT/BITShyd") |
|
``` |
|
|
|
3. **Preparing Input** |
|
- **Text Input**: This model uses text prompts, ideally incorporating facial expression indicators for contextual awareness. |
|
- **Image Input** (Optional): For real-time interaction, integrate with a facial expression API to enhance response generation based on user expressions. |
|
|
|
4. **Generate a Response** |
|
```python |
|
input_text = "Hello, I feel anxious today." |
|
inputs = tokenizer(input_text, return_tensors="pt") |
|
output = model.generate(**inputs, max_length=50) |
|
print(tokenizer.decode(output[0], skip_special_tokens=True)) |
|
``` |
|
|
|
--- |
|
|
|
## Usage Examples |
|
|
|
### 1. Mental Health Support Assistant |
|
```python |
|
input_text = "I'm feeling overwhelmed and don't know how to manage my stress." |
|
inputs = tokenizer(input_text, return_tensors="pt") |
|
output = model.generate(**inputs, max_length=50) |
|
print(tokenizer.decode(output[0], skip_special_tokens=True)) |
|
``` |
|
Expected Response: |
|
> "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?" |
|
|
|
### 2. Emotionally Responsive AI Assistant |
|
This example integrates with a facial expression API to adjust responses based on detected emotions (like sadness or happiness). |
|
|
|
```python |
|
detected_emotion = "sadness" # Detected through facial expression analysis |
|
input_text = "I've been feeling lonely lately." |
|
inputs = tokenizer(f"{detected_emotion} | {input_text}", return_tensors="pt") |
|
output = model.generate(**inputs, max_length=50) |
|
print(tokenizer.decode(output[0], skip_special_tokens=True)) |
|
``` |
|
Expected Response: |
|
> "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." |
|
|
|
--- |
|
|
|
## Model Training and Fine-Tuning Details |
|
|
|
This model was trained with **LoRA** and **Unsloth**: |
|
|
|
- **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. |
|
- **Unsloth**: Unsloth enhances inference speed, allowing the model to process requests with lower latency, suitable for real-time interaction scenarios. |
|
|
|
Training Configurations: |
|
|
|
| Parameter | Description | |
|
|-----------------|-------------------------------------| |
|
| Model Size | 8 Billion Parameters | |
|
| Epochs | 3 | |
|
| Learning Rate | 5e-5 | |
|
| Batch Size | 8 | |
|
| Dataset | Amod/mental_health_counseling_conversations | |
|
| Optimizations | LoRA and Unsloth | |
|
|
|
--- |
|
|
|
## Future Work |
|
|
|
- **Advanced Emotion Detection**: Plan to integrate a broader range of emotions and body language cues. |
|
- **Interactive Widgets**: Adding Hugging Face widget for real-time interactions directly on this model’s page. |
|
- **Deployment Options**: Explore integration with cloud-based platforms for widespread access. |
|
|
|
--- |
|
|
|
## License |
|
|
|
This model is available under the Apache 2.0 License. For detailed terms, refer to the [LICENSE](LICENSE.md) file in the repository. |
|
|
|
--- |
|
|
|
### Explore the Model |
|
|
|
Interact with the model here: [LOHAMEIT/BITShyd](https://huggingface.co/LOHAMEIT/BITShyd) |
|
|
|
For any feedback or collaboration requests, feel free to reach out on Hugging Face or GitHub! |
|
|
|
--- |
|
|
|
|