Skip to content

New CrossSubjecEvaluation that supports transfer learning methods #1077

Description

@toncho11

I am proposing a new class called CrossSubjectTargetAwareEvaluation that extends cross-subject evaluation to pipelines that require subject metadata or optional unlabeled/labeled target-subject calibration data. The existing CrossSubjectEvaluation becomes one of 6 options that can be configured.

All this is motivated by the large number of papers on Transfer Learning. So we need:

  • a way to provide not merged subjects, but all subjects separately, so that transfer learning methods can work. Let's call this "metadata-aware".
  • allow a well defined controlled access to the held out subject (HOS), also called the test subject or heldout target

I myself am working on a transfer learning cross subject method and all this is motivated by real needs.

Currently in my code I have defined:

class CsMode(Enum):
    HOS_SOURCE_ONLY_TRIALWISE = auto()  # Source-only training; each held-out target trial is predicted independently.
    HOS_SOURCE_ONLY_BLOCKWISE = auto()  # Source-only training; held-out target trials are predicted as a block, matching standard MOABB behavior.
    HOS_UNLABELED_20P = auto()          # First 20% of held-out target trials are used unlabeled for adaptation; remaining 80% are evaluated.
    HOS_UNLABELED_50P = auto()          # First 50% of held-out target trials are used unlabeled for adaptation; remaining 50% are evaluated.
    HOS_UNLABELED_100P = auto()         # All held-out target trials are used unlabeled for transductive adaptation and also evaluated.
    HOS_LABELED_20P = auto()            # First 20% of held-out target trials are used with labels for supervised calibration; remaining 80% are evaluated. 

This will allow people to start comparing their methods clearly. Some will focus on HOS_UNLABELED_20P, others on HOS_SOURCE_ONLY_TRIALWISE, but the results will become comparable. I work on HOS_SOURCE_ONLY_TRIALWISE.

So the objective is:

  • preserve MOABB cache/result/save mechanics
  • support old pipelines
  • support final metadata-aware classifiers (heldout subject aware classifiers)
  • support intermediate metadata-aware transformers (heldout subject aware transformers)
  • transform X_target_unlabeled through earlier steps

Notes:

  • HOS_SOURCE_ONLY_BLOCKWISE predicts the target block after source-only training (the heldout subject is not provided during training), while HOS_UNLABELED_100P explicitly uses the entire unlabeled target block during fit/adaptation before predicting it.

I will provide code in a PR later. As you can imagine, it is a big feature :)

I think the best strategy is to have CrossSubjectTargetAwareEvaluation along the CrossSubjectEvaluation. And allow people to test it for a while.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions