Skip to content

Hub license= metadata defaults to bsd-3-clause for non-BSD models (incl. CC BY-NC ones) #1139

Closed

Description

@bruAristimunha

Summary

EEGModuleMixin.__init_subclass__ accepts a license= keyword (braindecode/models/base.py:217) and forwards it to the HuggingFace model-card metadata. It defaults to bsd-3-clause. Only one model in the library actually sets it, so every other model — including several that are not BSD-3 — publishes bsd-3-clause in its model card.

For the noncommercial models this is a licensing problem, not a cosmetic one: pushing them to the Hub advertises permissive terms for code that is CC BY-NC.

Evidence

Read back at runtime from cls._hub_mixin_info.model_card_data.license, compared against each file's own # License: header:

Model File header says Hub metadata
BrainModule CC BY-NC 4.0 bsd-3-clause
EMG2QwertyNet CC BY-NC 4.0 bsd-3-clause
MetaNeuromotorHand CC BY-NC 4.0 bsd-3-clause
CTNet MIT bsd-3-clause
DANCE MIT bsd-3-clause
MEDFormer MIT bsd-3-clause
TCFormer MIT bsd-3-clause
MVPFormer Apache-2.0 bsd-3-clause
ZUNA Apache-2.0 bsd-3-clause

EEGMiner is listed in NOTICE.txt as CC BY-NC 4.0 but has no header line and also reports bsd-3-clause.

Reproduce:

import inspect
import braindecode.models as M

for name in sorted(M.__all__):
    cls = getattr(M, name, None)
    if inspect.isclass(cls) and hasattr(cls, "_hub_mixin_info"):
        print(name, cls._hub_mixin_info.model_card_data.license)

Suggested fix

Add the correct license= to each affected class declaration, e.g.

class EMG2QwertyNet(EEGModuleMixin, nn.Module, license="cc-by-nc-4.0"):

A test asserting that a class's license= metadata is consistent with its file's # License: header would stop this recurring. Related: the NOTICE/README gaps and the missing-header issue filed alongside this one.

Activity

  1. bruAristimunha commented on Aug 27, 2026

    @bruAristimunha
    CollaboratorAuthor

    Correction and expansion — verified against upstream LICENSE files

    The table in the issue body was built by matching # License: header lines only. That was too narrow in one direction and too loose in another. I have since fetched the actual LICENSE file from each cited upstream repository. Corrected findings:

    Two entries in the original table were wrong. attn_sleep.py and steegformer.py do not declare MIT as their own license — attn_sleep.py reproduces upstream's MIT notice as an attribution block, and steegformer.py mentions MIT for one borrowed helper (channels_mapping). Both declare BSD-3 for themselves. Apologies for the noise.

    A larger category was missed entirely: files declaring BSD-3 while deriving from a non-BSD upstream. Upstream licenses below are from the repository's own LICENSE file, not GitHub's classifier:

    File Cited upstream Upstream LICENSE File header says
    codebrain.py jingyingma01/CodeBrain Apache-2.0 BSD-3
    eegpt.py BINE022/EEGPT Apache-2.0 BSD-3
    labram.py 935963004/LaBraM MIT BSD-3
    cbramod.py wjq-learning/CBraMod MIT BSD-3
    attn_sleep.py emadeldeen24/AttnSleep MIT BSD-3
    patchedtransformer.py timonkl/PatchedBrainTransformer MIT BSD-3
    steegformer.py LiuyinYang1101/STEEGFormer MIT BSD-3
    biot.py, contrawr.py, sparcnet.py ycq091044/BIOT MIT (no license line)

    Upstreams that declare no license at all, which is a separate and arguably harder problem, since unlicensed code grants no rights to redistribute or adapt: abbassalami/eeg-itnet (eegitnet.py), SheepTAO/MSVTNet (msvtnet.py), SalvoCalcagno/eeg-music-challenge-icassp-2025-baselines (syncnet.py), SPOClab-ca/ThinkerInvariance (tidnet.py).

    Important caveat, which is why this issue should not be actioned mechanically: none of the above is automatically a licensing violation. A clean-room reimplementation written from a paper does not inherit the reference implementation's code license, and several files say exactly that about themselves — fbcnet.py, for instance, states it "has only been reimplemented from the paper". Whether each file is a derivative of the code or an independent implementation is a per-file judgment that has to be made by someone who knows how it was written.

    So the actionable split is:

    • Mechanical and safe now: the license= kwarg for files whose own header already states a non-BSD license (ctnet.py, dance.py, medformer.py, tcformer.py, ifnet.py, mvpformer.py, zuna.py, luna.py, brainmodule.py, eegminer.py, emg2qwerty.py, meta_neuromotor.py). These only make the metadata agree with what the file already claims.
    • Needs a per-file provenance decision: everything in the two lists above. Tracked in 14 model files have no # License: header line #1141.

    Reproduce the upstream side with:

    gh api repos/<owner>/<repo>/license --jq '.content' | base64 -d | head -3
  2. bruAristimunha commented on Aug 27, 2026

    @bruAristimunha
    CollaboratorAuthor

    Verified by cloning every upstream repository

    Previous comments used the GitHub API's license endpoint, which reads one root file and maps it to an SPDX id. That misses non-standard licenses (reported as NOASSERTION) and non-root license files. I have now shallow-cloned all 19 upstream repositories cited in braindecode/models/*.py and read the license files on disk. Two findings change what this issue should do.

    1. emg2qwerty.py understates its license — ShareAlike is missing

    braindecode/models/emg2qwerty.py states:

    # License: Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
    # Inherits CC BY-NC 4.0; not covered by braindecode's BSD-3 license.
    

    The actual LICENSE in facebookresearch/emg2qwerty reads:

    Attribution-NonCommercial-ShareAlike 4.0 International
    

    It is CC BY-NC-SA 4.0, not CC BY-NC 4.0. ShareAlike is a strictly stronger obligation — derivatives must be distributed under the same terms — and braindecode is currently advertising weaker terms than the file actually carries, on already-merged code. The correct license= value is cc-by-nc-sa-4.0, and the header and NOTICE.txt entry (see #1140) need the same correction.

    For contrast, facebookresearch/generic-neuromotor-interface really is plain CC BY-NC 4.0, so meta_neuromotor.py is correct as written. The two Meta repos differ, which is presumably how this was missed.

    2. TSception is under a non-standard noncommercial license, not BSD

    braindecode/models/tsinception.py states # License: BSD (3-clause) and cites deepBrains/TSception. That repository contains no LICENSE file — it has LICENSE-CBCR:

    CBCR License 1.0
    Copyright 2022 Centre for Brain Computing Research (CBCR)
    
    Redistribution and use for non-commercial purpose in source and binary forms,
    with or without modification, are permitted provided that ...
    

    It is BSD-3 clause text with "for non-commercial purpose" substituted into the grant. That is not BSD-3 and not an OSI-approved licence. The GitHub API reports it as NOASSERTION, which is why earlier passes did not catch it.

    This one cannot be resolved by metadata alone: it depends on whether tsinception.py is derived from that code or written from the paper (Ding et al.). If derived, braindecode is distributing noncommercially-restricted code under a BSD-3 label. Flagging for #1141; someone who knows the file's provenance should settle it.

    3. Confirmed with no license file at all

    Clone confirms, rather than merely the API reporting nothing: SPOClab-ca/ThinkerInvariance (tidnet.py), SalvoCalcagno/eeg-music-challenge-icassp-2025-baselines (syncnet.py), SheepTAO/MSVTNet (msvtnet.py), abbassalami/eeg-itnet (eegitnet.py).

    Reproduce

    git clone --depth 1 --filter=blob:none --no-checkout https://github.com/<slug>.git d
    git -C d sparse-checkout set --no-cone '/LICENSE*' '/COPYING*' '/NOTICE*'
    git -C d checkout && head -3 d/LICENSE*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions