This project focuses on detecting Body-Focused Repetitive Behaviors (BFRB) using sensor data, including IMU, thermal, and time-of-flight sensors. The goal is to classify different types of BFRB gestures to aid in behavioral therapy and monitoring.
cmi-detect-behavior-with-sensor-data/
├── data_preparation_full/ # Full sensor data processing
├── data_preparation_imu_only/ # IMU-only data processing
├── kaggle_evaluation/ # Kaggle competition evaluation code
├── analyze_features.py # Feature analysis scripts
├── baseline_model.py # Baseline model implementation
├── bfrb_models.py # Advanced BFRB detection models
├── data_preparation_steps.py # Data preprocessing pipeline
├── enhanced_feature_engineering.py # Advanced feature engineering
├── explore_data.py # Data exploration scripts
├── feature_engineering.py # Basic feature engineering
├── requirements.txt # Python dependencies
├── run_bfrb_pipeline.py # Main pipeline execution
├── sequence_models.py # Sequence-based models (LSTM, etc.)
└── train_sequence_models.py # Training scripts for sequence models
- Multi-sensor data processing: Handles IMU, thermal, and time-of-flight sensor data
- Advanced feature engineering: Time-domain, frequency-domain, and statistical features
- Multiple model architectures:
- Traditional ML models (XGBoost, LightGBM)
- Deep learning models (LSTM, CNN, etc.)
- Ensemble methods
- Kaggle competition ready: Includes evaluation framework
-
Clone the repository:
git clone https://github.com/yourusername/cmi-detect-behavior-with-sensor-data.git cd cmi-detect-behavior-with-sensor-data
-
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Data Preparation:
python data_preparation_steps.py
-
Feature Engineering:
python enhanced_feature_engineering.py
-
Train Models:
- For traditional ML models:
python run_bfrb_pipeline.py
- For sequence models:
python train_sequence_models.py
- For traditional ML models:
-
Evaluate Models:
- Run the Kaggle evaluation framework:
python kaggle_evaluation/cmi_inference_server.py
- Run the Kaggle evaluation framework:
The dataset includes:
- Sensor Data:
- IMU (acc_x, acc_y, acc_z, rot_w, rot_x, rot_y, rot_z)
- Thermal sensors (thm_1 to thm_5)
- Time-of-Flight sensors (tof_1 to tof_3)
- Demographics: Age, sex, handedness, height, arm measurements
- Labels: 8 target BFRB gestures and 10 non-target behaviors
This project is licensed under the MIT License - see the LICENSE file for details.
- Kaggle competition: CMI Detect Behavior with Sensor Data
- Special thanks to the competition organizers and data providers