An AI-powered multi-modal emotion analysis system that supports text, audio, and face processing for real-time emotion and stress detection.
- Text Emotion Analysis: Detect emotions from written text using DistilRoBERTa
- Voice Emotion Detection: Analyze audio input for emotional content using Wav2Vec2
- Face Emotion Detection: Recognize facial expressions through webcam input using CNN models
- Real-time Processing: Instant emotion analysis with live feedback
- Multi-modal Fusion: Combine multiple emotion sources for enhanced accuracy
- Privacy-focused: All processing happens locally, no data is stored on servers
- React with TypeScript
- Vite for fast development
- Tailwind CSS for styling
- Shadcn UI components
- Framer Motion for animations
- Flask (Python)
- Hugging Face Transformers
- PyTorch for deep learning models
- TensorFlow for audio processing
- Text: DistilRoBERTa for text emotion classification
- Audio: Wav2Vec2 for voice emotion recognition
- Face: dima806/facial_emotions_image_detection CNN model
NeuroPulse consists of three independent backend services:
- Audio Service (Port 5000): Handles voice emotion detection
- Text Service (Port 5001): Processes text emotion analysis
- Face Service (Port 5002): Manages facial emotion recognition
The React frontend connects to all three services simultaneously, providing a unified interface for multi-modal emotion analysis.
- Python 3.8+
- Node.js 16+
- npm/yarn
- Install Python dependencies:
cd backend
pip install -r requirements.txt- Start all backend services:
# Option 1: Using the batch file (Windows)
start_services.bat
# Option 2: Start each service manually
python audio_model.py # Port 5000
python text_model.py # Port 5001
python face_model.py # Port 5002- Install dependencies:
cd frontend
npm install- Start the development server:
npm run devThe application will be available at http://localhost:3000
GET /api/health- Service health checkGET /api/emotions- Available emotionsPOST /api/record-and-predict- Record and analyze audioPOST /api/upload-and-predict- Upload and analyze audio filePOST /api/predict-from-data- Analyze raw audio dataGET /api/available-devices- List audio input devices
GET /api/health- Service health checkGET /api/emotions- Available emotionsGET /api/model-info- Model informationPOST /api/analyze-text- Analyze text emotionPOST /api/analyze-batch- Batch text analysis
GET /api/health- Service health checkGET /api/emotions- Available emotionsGET /api/model-info- Model informationGET /api/test-image- Sample test imagePOST /api/analyze-face- Analyze face emotionPOST /api/analyze-batch- Batch face analysis
All backend services return a consistent JSON response format:
{
"success": true,
"predictions": [
{"label": "emotion_name", "score": 0.85}
],
"top_emotion": "emotion_name",
"confidence": 0.85
}This unified format makes it easy for the frontend to handle responses from all services consistently.
Run backend tests:
cd backend/tests
python test_audio_integration.py
python face_emotion_webcam_test.py
python interactive_text_test.pyNeuroPulse/
├── backend/
│ ├── audio_model.py # Audio emotion analysis service
│ ├── text_model.py # Text emotion analysis service
│ ├── face_model.py # Face emotion analysis service
│ ├── requirements.txt # Python dependencies
│ └── tests/ # Test scripts
└── frontend/
├── src/
│ ├── components/ # React components
│ ├── services/ # API services
│ └── App.tsx # Main application
├── package.json # Frontend dependencies
└── vite.config.ts # Vite configuration
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hugging Face for providing pre-trained models
- Facebook Research for Wav2Vec2
- All contributors who have helped shape NeuroPulse