HMS - Harmful Brain Activity Classification
What the winners did
Compared from 3 published write-ups Β· AI summary, check the originalsThe hard part: The competition required handling massive, noisy EEG data with ambiguous labels (indicated by vote counts), where distinguishing true signal from augmented duplicates and selecting the right representation (2D vs 1D, time vs frequency) was critical for generalization.
Lessons to take to your next competition All lessons & trends β
- Treating multichannel time-series data as 2D images (montages) can be more effective than treating channels independently, as it preserves spatial context for vision transformers/CNNs.
- Rigorous data cleaning is essential; identifying and separating original signals from augmented duplicates (e.g., via vote counts) significantly improves validation reliability and model performance.
- Ensembling diverse model architectures (e.g., 1D vs 2D, different backbones) generally yields better results than scaling a single architecture, but simple averaging may not capture optimal interactions, suggesting learned blending can be superior.
- Post-processing steps like adjusting class biases or learning ensemble weights can provide significant leaderboard jumps, sometimes rivaling the gains from adding new models.
- Avoiding information leakage is critical; batch-wise normalization and using long-duration spectrograms that dilute specific events can hurt performance compared to carefully normalized, shorter-segment features.
Shared by the top teams (the baseline)
- Using a 'double banana' montage or 2D image structure to arrange 16 EEG channels, allowing 2D vision backbones to capture spatial relationships between left and right brain hemispheres. holiday, nvidia/DD
- Filtering or weighting training data based on the number of votes (vote_num) to prioritize high-confidence labels and remove redundant augmented duplicates. holiday, nvidia/DD
- Applying bandpass filtering (e.g., Butterworth or MNE) and amplitude clipping (e.g., to Β±1024) to clean the raw EEG signal before feature extraction. holiday, nvidia/DD
- Utilizing pretrained vision backbones (2D or 3D CNNs) and employing cosine learning rate scheduling during training. holiday, nvidia/DD
What set each team apart (the edge)
- holiday: Implemented a two-stage training process where the loss weight was initially proportional to the number of voters, then switched to a fixed weight for lower-confidence data, combined with a 'double-head' model concatenating features from 3D spectrum and 2D raw EEG models.
- nvidia/DD: Combined 1D CNNs with Squeezeformer blocks alongside 2D Mixnet models, and used a lightweight neural network to learn optimal blend weights for the 23-model ensemble, plus added class-specific bias terms to logits.
Side by side
The same questions answered for each published solution| Team | Validation | Models | Ensembling & post-processing | Didn't work |
|---|---|---|---|---|
| #1 team Sony
The solution relied on a collective ensemble pipeline contributed by four distinct team members using Group K-fold validation. |
|
not mentioned |
|
not mentioned |
| #2 holiday
Concatenating 16-channel EEG into a 'double banana' montage image allows 2D/3D vision backbones to capture position-sensitive label information better than treating channels as separate images. |
|
|
|
|
| #3 nvidia/DD
A robust solution combining 2D-CNNs on MelSpectrograms and 1D-CNNs with Squeezeformer, driven by rigorous data filtering and diverse augmentations. |
|
|
|
|
Solution cards
Structured notes from each write-up β the original is linkedπ₯ team Sony 0.272332 The solution relied on a collective ensemble pipeline contributed by four distinct team members using Group K-fold validation.
Validation
- Used Chris's method: normalize by summing labels with eeg_id and crop middle 10,000 frames.
- Employed Group K-fold with a 5-fold split.
- Required vote >=10 for validation.
Ensembling & post-processing
- Prediction pipeline combined contributions from yamash, suguuuuu, kfuji, and Muku.
π₯ holiday 0.273765 Concatenating 16-channel EEG into a 'double banana' montage image allows 2D/3D vision backbones to capture position-sensitive label information better than treating channels as separate images.
Validation
- 10-fold cross-validation used for training.
- Moved 1000 samples from validation to training, leaving 709 in val set.
- Validation performed using samples with vote_num >= 6.
- CV scores (e.g., 0.21+) correlated with public/private LB scores (e.g., 0.25/0.29).
Data & preprocessing
- Raw EEG data shaped as bsx16x10000.
- Filtered using MNE (0.5-20Hz) or scipy.signal (butter filter).
- Amplitude clipped to range +-1024.
- STFT applied with n_fft=512, win_length=128, hop_length 10 or 50.
Features
- Double banana montage: 16 channels rearranged into a 2D image structure.
- Spectrum images generated via STFT, clipped, and scaled by /1000.
- Raw EEG reshaped to bsx3x160x1000 for 2D vision models.
- Spectrum images duplicated 3 times to match RGB channel input.
Models
- X3D-L (3D-CNN) for spectrum features.
- EfficientNet-B5 (2D-CNN) for raw EEG and spectrum images.
- HGNet-B5 (2D-CNN) for raw EEG.
- Double-head model concatenating X3D-L spectrum and EfficientNet-B5 EEG features.
Training tricks
- Stage 1: 15 epochs, loss weight voters_num/20, Adamw lr=0.001, cosine scheduler.
- Stage 2: 5 epochs, loss weight=1, filter vote_num>=6, Adamw lr=0.0001, cosine scheduler.
- Augmentations: mirror EEG, flip left/right brain data.
- Random eeg_label_offset_seconds chosen per eegid for target averaging.
- Pretrained weights used for all backbones.
Ensembling & post-processing
- Final ensemble of 6 models: 2 spectrum, 3 raw EEG, 1 mixed.
- Combined MNE and scipy.signal filtered models for diversity.
What didn't work
- Feeding bsx4xHxW input to 2D-CNN produced worse results than one-image method.
- Ensembling 6 models improved score only slightly (0.28->0.27 private LB).
π₯ nvidia/DD 0.274112 A robust solution combining 2D-CNNs on MelSpectrograms and 1D-CNNs with Squeezeformer, driven by rigorous data filtering and diverse augmentations.
Validation
- Used 4-fold cross-validation split by patient ID to ensure generalization.
- Filtered validation set to rows with >9 votes to remove redundancy.
- Achieved strong correlation between cross-validation scores and leaderboard results.
- Identified that filtering out augmented duplicate rows improved validation reliability.
Data & preprocessing
- Filtered 106k training rows down to 6350 original 'true' data points.
- Distinguished original EEG segments from augmented shifts using SPaRCNet paper insights.
- Used high-quality (>8 votes) data for 2D models and lower-vote data for 1D models.
- Discarded 10-minute spectrograms as they provided no significant benefit.
- Avoided pseudo-labeling as it did not improve performance in experiments.
Features
- Applied MelSpectrogram transformation on-the-fly using torchaudio GPU implementation.
- Used 'double banana montage' ordering for 16 EEG channels to group left/right brain.
- Applied Butter bandpass filter (order 2) with variable low/highpass frequencies.
- Normalized signal via clipping to [-1024, 1024] and dividing by 32.
- Avoided batch-wise or sample-wise normalization to prevent information leakage.
Models
- 2D branch: Pretrained Mixnet backbones fed with concatenated 16-channel MelSpectrograms.
- 1D branch: Lightweight CNN with grouped convolutions followed by Squeezeformer blocks.
- 1D model used Conv2D to simulate Conv1D while interacting across all channels.
- Replaced CBAM attention with 3 layers of Squeezeformer for better stability.
- Added pointwise convolutions around depthwise convolutions in the 1D architecture.
Training tricks
- 2D models: 12-16 epochs, cosine LR decay (init 0.0012), batch size 32, drop path 0.2.
- 1D models: ~32 epochs, cosine LR decay (init 0.001), batch size 64 or 256.
- Augmentations included zeroing melspec nodes, random bandpass shifts, and time shifts.
- 1D-specific augmentations: left-right time flip and brain side switch (50% probability).
- 2D-specific augmentations: random shift of 10s center within 50s window.
- 1D training used decayed loss weights for low-vote data (3-8 and 1-2 votes).
Ensembling & post-processing
- Combined 5 1D CNN models and 18 Mixnet 2D CNN models into an ensemble.
- Used a simple neural network to learn optimal blend weights for the 23 models.
- Added a bias term for each of the 6 classes to the logits.
- Class bias adjustment jumped public leaderboard rank from 9th to 4th.
- Mean blend with higher weighting on 2D models was the initial strategy.
What didn't work
- Pseudo-labeling was tried but did not help performance.
- Stacking 16 signals next to each other caused unwanted neighbor interactions.
- Increasing hidden dimension or depth in 1D Squeezeformer did not help.
- Using 10-minute spectrograms did not significantly improve 2D model results.
No public write-up found for: #4 Aillis & GO & bilzard, #5 KTMUD.
Most Used Techniques
Aggregated across all top solutionsPodium Solutions
Gold, Silver, and Bronze winning approachesteam Sony
Key idea: The solution relied on a collective ensemble pipeline contributed by four distinct team members using Group K-fold validation.
See the solution card βholiday
Key idea: Concatenating 16-channel EEG into a 'double banana' montage image allows 2D/3D vision backbones to capture position-sensitive label information better than treating channels as separate images.
See the solution card βnvidia/DD
Key idea: A robust solution combining 2D-CNNs on MelSpectrograms and 1D-CNNs with Squeezeformer, driven by rigorous data filtering and diverse augmentations.
See the solution card βFull Solutions Leaderboard
5 solutions archived| Rank | Team | Score | Techniques | Write-up |
|---|---|---|---|---|
| π₯ |
team Sony
|
0.272332 |
Cross Validation
|
|
| π₯ |
holiday
|
0.273765 |
Augmentation
EfficientNet
Ensemble
PyTorch
|
|
| π₯ |
nvidia/DD
|
0.274112 |
Augmentation
Blending
CNN
Ensemble
GPT
GRU
HuggingFace
Neural Network
Pseudo Labeling
PyTorch
ResNet
Stacking
|
|
| #4 |
Aillis & GO & bilzard
|
0.276039 |
β
|
β |
| #5 |
KTMUD
|
0.276157 |
β
|
β |