ไธญๆๆๆกฃ | English
A non-invasive computer control system that combines facial expression recognition, head movement tracking, and gaze estimation, designed for hands-free human-computer interaction.
This system enables complex action game control, as demonstrated in the video showing Black Myth: Wukong defeating the Yin Tiger boss. It can also be used to play MOBA games like Honor of Kings, FPS games like CS2, and many other game types.
---We are hosting a global CS2 Arms Race Challenge: 2000 RMB for the champion. The first participant to complete the setup, achieve kills in Arms Race against bots, and publish a tutorial video will receive an additional 500 RMB bonus.
- ๐ฏ Overview
- ๐ Performance Evaluation
- ๐ Installation
- ๐ฎ Quick Start
- ๐ Expression & Control Configuration
- ๐ฏ Use Cases
- โ๏ธ Technical Details
- ๐ค Contributing
- ๐ License
Traditional assistive technologies face significant limitations: invasive brain-computer interfaces like Neuralink require surgical implantation, commercial eye trackers like Tobii lack precision for complex operations, and traditional assistive devices often involve cumbersome controls. NeuGaze addresses these challenges by integrating facial expressions, head movements, and gaze estimation to create an intuitive, hands-free control system.
| Component | Requirement | Description |
|---|---|---|
| ๐ท Camera | Standard webcam | No special hardware needed |
| ๐ป Processor | CPU-only operation | No GPU required |
| ๐ช OS | Windows | Other platforms may work but untested |
| Feature | Description | Icon |
|---|---|---|
| Gaze-based mouse control | Real-time calibration, precise tracking | ๐ฏ |
| Facial expression mapping | Keyboard/mouse action mapping | ๐ |
| Three-modal control | Combining gaze, expressions, and head movements | ๐ฎ |
| Customizable configurations | Adaptable for different use cases | โ๏ธ |
| Real-time performance | CPU-optimized inference | ๐ |
We conducted comprehensive testing using progressive training on multiple calibration datasets. The system achieves stable gaze tracking performance with the following metrics:
- Mean Error: 48mm (original)
- After Kalman Filtering: 40mm (optimized)
- Display Resolution: 3072ร1920
- Training Data: Multiple calibration datasets
๐ก Note: Current performance is indeed inferior to Tobii's results, but we welcome community collaboration for improvements!
Progressive training results showing error reduction and performance stability across multiple datasets. The analysis demonstrates consistent improvement in gaze accuracy as more training data is incorporated.
# Double-click to run the installation script
install.bat๐ Script Function Details
The script will automatically:
- โ Check Python version and conda environment
- โ
Create a conda environment named
neugaze - โ Guide you to activate the environment and install dependencies
- โ Verify successful installation
# Create and activate conda environment
conda create -n neugaze python=3.11.11
conda activate neugaze
# Install all dependencies
pip install -r requirements.txtWatch this video to quickly understand the system usage:
python config_gui_cpu.py- ๐ท Select your camera (default: camera 0)
- ๐ค Position your face in the center of the preview window
- โ Click "Confirm Selection"
- ๐ฏ Click "Start Calibration"
- ๐๏ธ Follow the on-screen dots with your gaze
- ๐ Keep your eyes open (photos are only taken when eyes are detected)
- โณ Wait for calibration to complete
- ๐ฎ Click "Start Evaluation"
- ๐ฑ๏ธ Your mouse cursor will now follow your gaze
- ๐ Use facial expressions to trigger actions
NeuGaze uses a sophisticated expression recognition system defined in configs/cpu.yaml. The system supports multiple control modes and customizable mappings.
The system recognizes facial expressions through MediaPipe landmarks and maps them to specific actions:
| Expression | Action Description | Triggered Operation |
|---|---|---|
Open Mouth (jawOpen) |
Drop your jaw naturally | ๐ฏ Mode selector - displays available control wheels |
Pucker Lips (mouthPucker) |
Make a kissing motion with pursed lips | ๐ฑ๏ธ Left mouse click |
Jaw Left (jawLeft) |
Shift your jaw to the left side | ๐ฑ๏ธ Right mouse click |
Jaw Right (jawRight) |
Shift your jaw to the right side | ๐ฑ๏ธ Middle mouse click |
Smile Left (mouthSmileLeft) |
Smile with only the left side of your mouth | ๐งญ Navigation/selection |
Smile Right (mouthSmileRight) |
Smile with only the right side of your mouth | ๐งญ Navigation/selection |
| Both Sides Smile | Full natural smile with both sides | โก Special commands |
| Head Movements | Tilt, turn, and nod your head | โจ๏ธ WASD keys and scrolling |
python learn\mediapipe_example.pyYou can use this program to view the scores for different expressions and adjust the thresholds accordingly.
left_click:
conditions:
- feature: mouthPucker
operator: '>'
threshold: 0.97
- feature: mouthFunnel
operator: <
threshold: 0.2
combine: ANDThe system supports multiple operation modes through the wheel interface:
Optimized for gaming with WASD movement and common game keys:
| Wheel Position | Key Mapping | Function Description |
|---|---|---|
| num1 | Z/X/C keys | ๐ฎ Common game actions |
| num2 | Shift | ๐ Sprint/crouch |
| num4 | Number keys 1-4 | โ๏ธ Weapon selection |
| num6 | Q/R/F/T keys | ๐ฏ Interaction keys |
| num8 | Space | โก Jump |
Specialized for Counter-Strike with tactical bindings:
| Wheel Position | Key Mapping | Function Description |
|---|---|---|
| num2 | Space | โฌ๏ธ Jump |
| num8 | Shift | ๐ถ Walk/precision |
| Mouse lock | Disabled | ๐ฏ For precise aiming |
Optimized for MOBA gameplay (็่ ่ฃ่/Arena of Valor):
| Wheel Position | Key Mapping | Function Description |
|---|---|---|
| num1-3 | Skill activation | โ๏ธ Skills 1-3 |
| num4 | M key | ๐บ๏ธ Map |
Full keyboard access for text input:
| Wheel Position | Key Mapping | Function Description |
|---|---|---|
| num4 | Complete alphabet | ๐ค Square layout letters |
| num6 | Numbers and symbols | ๐ข Square layout numbers and symbols |
| num2 | Modifier keys | โจ๏ธ Shift, Ctrl, Alt, etc. |
| num3 | Common shortcuts | ๐ Ctrl+C, Ctrl+V, etc. |
The system includes priority rules to prevent conflicting expressions:
priority_rules:
- when: num7
disable: [num2]
except: []Different input modes support different wheel layouts:
| Layout Type | Description | Use Case |
|---|---|---|
| Default | Circular arrangement | ๐ฎ Gaming modes |
| Square | Grid layout | โจ๏ธ Letter and symbol input |
Head orientation controls additional functions:
| Head Movement | Key Mapping | Function Description |
|---|---|---|
| Pitch (up/down) | W/S keys | โฌ๏ธโฌ๏ธ Up/down movement |
| Yaw (left/right) | A/D keys | โฌ ๏ธโก๏ธ Left/right movement |
| Roll (tilt) | Scroll wheel | ๐ Scrolling operations |
- ๐ฆฝ Mobility Assistance: Hands-free computer operation for users with limited mobility
- ๐ฅ Rehabilitation: Motor skill training through controlled head and facial movements
- ๐ฏ Immersive Gaming: Novel input method for enhanced gaming experiences
- ๐ Action Games: Complex action game control as demonstrated with Black Myth: Wukong boss battles
- ๐ MOBA Games: Strategic gameplay in Honor of Kings and similar MOBAs
- ๐ฏ FPS Games: Precision control for Counter-Strike 2 and other competitive shooters
- ๐ช Muscle Training: Facial and neck muscle exercise through interactive control
- ๐ฅฝ AR/VR Interfaces: Natural control for head-mounted displays
- ๐ Smart Glasses: Expression-based navigation without hand gestures
| Component | Function Description | Technical Implementation |
|---|---|---|
| ๐ฏ Intent Recognition | Comprehensive analysis of facial expressions, head movements, and gaze patterns | MediaPipe + custom algorithms |
| ๐ Intent Mapping | Translation of recognized intents into specific keyboard/mouse actions | Configuration-driven mapping system |
| ๐ญ Multi-Modal Fusion | Integration and prioritization of multiple simultaneous intents | Priority rule engine |
| โก Action Execution | Coordinated control system enabling complex gaming operations | Real-time control interface |
| ๐ Optimization | CPU-optimized inference pipeline for real-time performance | CPU-optimized inference |
| Limitation | Impact | Solution |
|---|---|---|
| ๐ Lighting Sensitivity | Performance degrades in poor or uneven lighting | Adjust environmental lighting |
| ๐ฏ Calibration Required | Individual calibration needed for optimal accuracy | Regular recalibration |
| ๐ Expression Training | Learning curve for natural expression control | Practice and adaptation |
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
- ๐ Report Issues: Submit bug reports
- ๐ก Feature Suggestions: Propose new feature ideas
- ๐ง Code Contributions: Submit pull requests
- ๐ Documentation Improvements: Help improve documentation
This project is licensed under Creative Commons Attribution-NonCommercial 4.0 International License.
- โ Share and adapt the code for personal use
- โ Use for research and educational purposes
- โ Create derivative works for non-commercial purposes (e.g., streaming, content creation)
- โ Sell the source code or derivatives
- โ Deploy as commercial hardware/software products
- โ Package as paid executable applications
- โ Use for commercial web services
๐ก Note: We provide this software freely to benefit the community while preventing exploitation by commercial entities. License terms may be updated to Apache-2.0 or MIT based on community feedback.
@article{yang2024neugaze,
title={NeuGaze: Facial Expression and Gaze-Based Computer Control},
author={Yang, Yiqian},
journal={arXiv preprint arXiv:2504.15101},
year={2024}
}โญ If this project helps you, please give us a star! โญ


