Skip to content

TinyMyo: Update hand gesture classification experiment details - #8

Open
MatteoFasulo wants to merge 24 commits into
pulp-bio:mainfrom
MatteoFasulo:patch-1
Open

TinyMyo: Update hand gesture classification experiment details#8
MatteoFasulo wants to merge 24 commits into
pulp-bio:mainfrom
MatteoFasulo:patch-1

Conversation

@MatteoFasulo

@MatteoFasulo MatteoFasulo commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Significant improvements to the EMG pretraining and finetuning data pipeline, focusing on efficiency, configuration flexibility, and dataset handling. The most important changes include a complete rewrite of the EMGPretrainDataset to use shared memory for high-performance data loading, simplification of the finetuning dataset, and updates to experiment configuration files for improved training and logging. Below are the key changes grouped by theme:

Data Loading and Dataset Refactoring

  • datasets/emg_pretrain_dataset.py: Completely refactored EMGPretrainDataset to use POSIX shared memory for loading HDF5 data, enabling efficient parallel data access and minimizing memory duplication across workers. Added support for min-max scaling and channel padding. The dataset now expects a single HDF5 file with group structure and loads all groups into a shared RAM block on initialization.
  • datasets/emg_finetune_dataset.py: Simplified EMGDataset by removing the cache and lazy file handle logic. The dataset now loads the entire HDF5 file into memory on initialization for faster access and supports both regression and classification modes.

Configuration and Experiment Management

  • config/data_module/emg_pretrain_data_module.yaml: Updated dataset definitions to use explicit train/val/test splits with new HDF5 file paths, and added support for channel padding where required.
  • config/experiment/TinyMyo_pretrain.yaml: Increased pretraining batch size to 512, reduced epochs to 30, enabled bf16 precision, and added WandB logging configuration. Updated optimizer and scheduler settings for improved training dynamics.
  • config/experiment/TinyMyo_finetune.yaml: Reduced number of workers, switched output logging to ${env:LOG_DIR}, updated model and trainer parameters, and added WandB logging configuration.

Changed details about the experiments performed.

  • Classification: Ninapro DB5, EPN612, and UCI EMG have been tested with 1 and 5 sec windows @ 200 Hz.
  • Regression: Ninapro DB8 has been tested with 100 and 500 ms windows @ 2000 Hz.

Copilot AI review requested due to automatic review settings February 27, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the experimental details in the TinyMyo model documentation to reflect revised window sizes and sampling rates used for hand gesture classification and kinematic regression experiments.

Changes:

  • Updated classification window sizes from 200 ms to 1 sec (DB5) and 1000 ms to 5 sec (EPN-612, UCI EMG)
  • Added sampling rate information (200 Hz) for classification datasets
  • Updated regression window sizes from 200 ms/1000 ms to 100 ms/500 ms for Ninapro DB8
  • Corrected dataset reference from "NinaPro EPN612 pipeline" to "EPN612 dataset"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/model/TinyMyo.md Outdated
Comment thread docs/model/TinyMyo.md
Comment thread docs/model/TinyMyo.md Outdated
Comment thread docs/model/TinyMyo.md Outdated
MatteoFasulo and others added 12 commits July 27, 2026 10:07
Updated dataset information and performance metrics for hand kinematic regression.
…s avoids namespace issues with third party libraries (e.g., datasets from HuggingFace)
…ory optimization for DDP

- finetuning dataset preload in RAM option and documentation
- regression task support for EMG finetuning
- additional dataset configurations (log dir, individual h5 file)
…ers, EMG finetuning dataset handling, and improved training script logging
- Added label smoothing and classification type options to the fine-tuning YAML.
- Updated input normalization settings for pretraining and fine-tuning.
- Revised documentation to clarify preprocessing and fine-tuning details.
- Improved error handling for classification type in the finetune task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants