👋

Hey Reachy Wake Word Detection

A custom on-device wake word detection application for Reachy Mini robot that responds to the "Hey Reachy" voice command. Developed with Edge Impulse and Reachy Mini SDK.

Edge Impulse logo

Hey Reachy Demo

Dataset Generation

Using synthetic voice generation with:

See the scripts used in this GitHub repository

Model Training

Trained on Edge Impulse with:

  • ~2.5 hours of synthetic data
  • MFCC for the audio features extraction
  • 2D Convolutional Neural Network (CNN) for classification
  • Optimized for embedded devices

View public project

Implementation

Built with:

Note:
This app won't run on Windows. Use Linux or MacOS.

Setup Instructions

1. Clone the repository

git clone git@hf.co:spaces/luisomoreau/hey_reachy_wake_word_detection
cd hey_reachy_wake_word_detection

2. Create and activate virtual environment

python3.12 -m venv venv
source venv/bin/activate # Linux/MacOS
# .\venv\Scripts\activate # Windows

3. Install dependencies

pip install -e .

4. Launch the Reachy Mini Daemon

Open the Reachy Mini Desktop App or run:

reachy-mini-daemon

5. Run the application

python hey_reachy_wake_word_detection/main.py
Note: This project aims to be a base that you can freely modify. Don't expect Alexa or "OK Google"-grade performance. The model was trained on only ~2.5 hours of data.

Expected Output

Running on: darwin arm64
INFO: Started server process [98489]
INFO: Waiting for application startup.
...
Detected system: darwin arm64
Selected model: hey-reachy-wake-word-detection-mac-arm64.eim
Using audio device: Reachy Mini Audio (ID: 1)
Loaded runner for "Developer Relations / Hey Reachy - Wake word detection"
...
Classification: {'hey_reachy': '0.8501', 'noise': '0.0000', 'other': '0.1499'}
Detection score: 0.8501
🎤 KEYWORD DETECTED - Executing actions!
Playing sound: /path/to/greetings-audio/speech_g4rDsF5OhcU.ogg

Create Your Own Keyword

Want to use your own wake word instead of "Hey Reachy"? Follow these steps to create your own keyword spotting model:

1. Follow the Edge Impulse Tutorial

Start with the official Edge Impulse Keyword Spotting Tutorial. This will guide you through:

  • Collecting or generating audio data for your keyword
  • Training a custom model
  • Testing and deploying your model

You can also examine the Hey Reachy public project for reference.

2. Export Your Model

  1. Go to the "Deployment" section in Edge Impulse
  2. Select the appropriate platform:
    • "Linux (AARCH64)"
    • "Linux (x86_64)"
    • "MacOS (arm64)"
    • "MacOS (x86)"
  3. Download the `.eim` model file
  4. Place it in the `models` directory of this project, using the appropriate naming convention:
    your-keyword-mac-arm64.eim # For Mac ARM64
    your-keyword-linux-x86_64.eim # For Linux x86_64
    your-keyword-linux-aarch64.eim # For Linux ARM64

3. Update the Code

Modify the `model_mapping` dictionary in `main.py` to include your model:

model_mapping = {
('darwin', 'arm64'): "your-keyword-mac-arm64.eim",
('darwin', 'x86_64'): "your-keyword-mac-x86_64.eim",
('linux', 'aarch64'): "your-keyword-linux-aarch64.eim",
('linux', 'armv7l'): "your-keyword-linux-armv7.eim",
('linux', 'x86_64'): "your-keyword-linux-x86_64.eim"
}

Also update the classification label check:

score = res['result']['classification'].get("your_keyword", 0)

4. Run Your Custom App

python hey_reachy_wake_word_detection/main.py

Troubleshooting

If you encounter issues:

Note about audio: The app uses sounddevice directly instead of mini.media.get_audio_sample() due to some compatibility issues with the Edge Impulse Python SDK.