# 107th place solution

Huge thanks to the organizers and fellow participants for making this competition such a fun and rewarding journey! 🎉 Congrats to the winners, and cheers to everyone who learned, shared, and grew along the way 🚀
Especially, we would like to thank these following people together with their amazing notebooks from which we learned how to process data:
(1)
[@jiazhuang](https://www.kaggle.com/jiazhuang)
for
[https://www.kaggle.com/code/jiazhuang/cmi-imu-only-lstm](https://www.kaggle.com/code/jiazhuang/cmi-imu-only-lstm)
(2)
[@pepushi](https://www.kaggle.com/pepushi)
for
[https://www.kaggle.com/code/pepushi/imu-tof-thm-fusion-with-physics-fe-mixup-lb0-8](https://www.kaggle.com/code/pepushi/imu-tof-thm-fusion-with-physics-fe-mixup-lb0-8)
(3)
[@wasupandceacar](https://www.kaggle.com/wasupandceacar)
for
[https://www.kaggle.com/code/wasupandceacar/lb-0-841-5fold-single-model-with-split-sensors](https://www.kaggle.com/code/wasupandceacar/lb-0-841-5fold-single-model-with-split-sensors)
Strategy
(1) K-fold cross-validation with StratifiedGroupKFold
2 ways for splitting data with StratifiedGroupKFold:
group: subjects, stratify: gestures (SS1).
group: subjects, stratify: gestures + missing Helios data (THM/TOF) (SS2).
(2) Diversify model architectures and training parameters for boosting ensemble.
We found this article very useful to have better training strategy for ensemble:
[Managing Diversity in Regression Ensembles](https://dl.acm.org/doi/pdf/10.5555/1046920.1194899)
.
The single error can be decomposed into:
$$
\mathbb{E}[(y-\hat{f}(x))^2] = \text{Bias}^2 \ (\text{underfitting}) + \text{Variance} \ (\text{overfitting})
$$
The ensemble error:
$$
E\left[(\bar{f} - t)^2\right] = \overline{\text{bias}}^2 + \frac{1}{M} \, \overline{\text{var}} + \left(1 - \frac{1}{M} \right) \overline{\text{covar}}
$$
where:
\(\overline{\text{bias}}\) is the averaged bias of the ensemble members
\(\overline{\text{var}}\) is the averaged variance of the ensemble members
\(\overline{\text{covar}}\) is the averaged covariance of the ensemble members
Based on this, the ensemble will help to decrease variance, thus decreasing the error. However at the same time if the models we used for ensemble are correlated, it will increase the error through this component \((1 - \frac{1}{M}) \overline{\text{covar}}\). Therefore, we try to diversify the model by:
training models on different frameworks: Tensorflow and Pytorch
splitting more folds 10-20 folds and each fold train with different seeds
building model with different input features
different outputs: (a) 18 target and non-target gestures; (b) 8 target gestures + 1 grouped non-target gesture.
(3) Analyze the model performance to gain insights and directions to improve the results.
![performance-analysis](assets/3becc7b94bfd234838e24cf7.svg)
We started by building a performance analysis pipeline to see how model accuracy relates to different features and to spot opportunities for improvement.
Some findings when analyzing IMU only and IMU-THM-TOF models:
When THM and TOF data are missing, the IMU only model outperforms the IMU-THM-TOF model --> asign higher weights for IMU_only model when THM & TOF are not available.
Both models achieve higher accuracy on adults, males, and right hands compared to children, females, and left hands. However, this gap may be influenced by the co-occurrence of missing rotation/THM/TOF data with these groups. --> upsampling for children, females, and left hands during training.
No significant performance differences are observed across height, shoulder-to-wrist length, or elbow-to-wrist length. --> no need to use these features during training.
For example, here is the performance when TOF is missing:
IMU only model: the results of TOF missing or present are not different significantly.
![IMU-only](assets/62e14cac17e613e962b09f0f.png)
IMU-THM-TOF: When TOF is missing, the results drop significantly.
![ IMU-THM-TOF](assets/ffa36f7a2f56b1a66270775d.png)
Implementation
Some selections of our trained models:
model ID
features
architecture
splitting
framework
CV
public LB
private LB
M1
IMU only (maxlen=256, seed=2025)
[cmi imu-only lstm by jiazhuang](https://www.kaggle.com/code/jiazhuang/cmi-imu-only-lstm)
20-fold SS1
Pytorch
0.789
0.799
0.789
M1
IMU only (maxlen=256, seed=42)
[cmi imu-only lstm from jiazhuang](https://www.kaggle.com/code/jiazhuang/cmi-imu-only-lstm)
20-fold SS1
Pytorch
0.785
0.798
0.791
M1+M2
0.801
0.796
M3
IMU+THM+TOF
[IMU × TOF/THM Fusion with Physics‑FE & MixUp by pepushi](https://www.kaggle.com/code/pepushi/imu-tof-thm-fusion-with-physics-fe-mixup-lb0-8)
20-fold SS1
Tensorflow
0.826
0.825
0.813
M4
IMU+THM+TOF + raw TOF
[wasupandceacar's architecture](https://www.kaggle.com/code/wasupandceacar/lb-0-841-5fold-single-model-with-split-sensors)
with modified some channels
10-fold SS2
Pytorch
0.833
0.815
M5
IMU+THM+TOF + raw TOF
[wasupandceacar's architecture](https://www.kaggle.com/code/wasupandceacar/lb-0-841-5fold-single-model-with-split-sensors)
with modified some channels
10-fold SS2
Tensorflow
0.837
0.815
M4+M5
0.837
0.819
M6
IMU+THM+TOF
[IMU × TOF/THM Fusion with Physics‑FE & MixUp by pepushi](https://www.kaggle.com/code/pepushi/imu-tof-thm-fusion-with-physics-fe-mixup-lb0-8)
with 9-class output
20-fold SS1
Tensorflow
0.811
0.794
0.800
Public shared models
model ID
link
version
CV
public LB
private LB
P1
[LB 0.841-5fold single model with split sensors](https://www.kaggle.com/code/wasupandceacar/lb-0-841-5fold-single-model-with-split-sensors)
by
[wasupandceacar](https://www.kaggle.com/wasupandceacar)
v4
0.861
0.841
0.824
P2
[Gated GRU + Hybrid Ensemble_v02](https://www.kaggle.com/code/pepushi/gated-gru-hybrid-ensemble-v02)
by
[pepushi](https://www.kaggle.com/pepushi)
v10
0.835
0.816
P3
[LB 0.82-5fold single bert model](https://www.kaggle.com/code/wasupandceacar/lb-0-82-5fold-single-bert-model)
by
[wasupandceacar](https://www.kaggle.com/wasupandceacar)
v7
0.829
0.809
Ensemble(our self-trained models in bold)
ensemble ID
weights
Public LB
private LB
selected
E1
if THM & TOF are missing {
M1: 0.5
, P1: 0.5} else {
M3: 0.5
, P1: 0.5}
0.849
0.834
no
E2
if THM & TOF are missing {
M1: 0.4
, P1: 0.4, P2: 0.2} else {
M3: 0.25
, P1: 0.5, P2: 0.25}
0.849
0.837
no
E3
if THM & TOF are missing {
M1: 0.4
, P1: 0.4, P2: 0.2} else {
M3: 0.5
, P1: 0.5}
0.850
0.838
no
E4
if THM & TOF are missing {
M1+M2: 0.3
, P1: 0.3, P2: 0.2, P3: 0.2} else {
M3: 0.1
, P1: 0.4, P2: 0.25, P3: 0.25}
0.855
0.834
yes
E4
if THM & TOF are missing {
M1+M2: 0.3
, P1: 0.3, P2: 0.2, P3: 0.2} else {P1: 0.4, P2: 0.35, P3: 0.35}
0.857
0.834
yes