Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HMSコンペ 11th Solution (team : kansai-kaggler)
Search
T88
July 04, 2024
Programming
1.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HMSコンペ 11th Solution (team : kansai-kaggler)
T88
July 04, 2024
More Decks by T88
See All by T88
polarsのudfとかpluginとか触ってみた
t88
0
3.4k
忙しくて手を動かせない時もいい感じに進捗出してくれるAgent作りたい
t88
10
6k
レコメンドコンペ入門
t88
1
1.5k
Other Decks in Programming
See All in Programming
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.8k
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.9k
Performance Engineering for Everyone
elenatanasoiu
0
260
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
フィードバックで育てるAI開発
kotaminato
1
110
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
240
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
190
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
240
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
350
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
200
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
7
3.3k
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
Faster Mobile Websites
deanohume
310
32k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
How to build a perfect <img>
jonoalderson
1
5.8k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
240
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
Abbi's Birthday
coloredviolet
3
8.5k
Transcript
HMSコンペ 11th Solution Team: kansai-kaggler
チームメンバー P-SHA TR
コ ン ペ 概 要 コ ン ペ 概 要
概要とポイント Team merge するまで 01 01
チームマージの経緯 かなり前から意識 そこから TRを抜き浮上
LB追いついたら チームマージしてあげる チームマージの経緯 P-SHA(T88) TR(Ryushi)
チームマージの経緯 1週間後
チームマージの経緯 Kansai-Kagglerチーム結成
HMSコンペ概要 脳波から専門家の6種類の診断確率を予測するコンペ データとしては以下が与えられた EEG スペクトログラム メタ/ラベルデータ 目的変数は専門家のvote率 https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/468010
S o l u t i o n S o
l u t i o n 11th pl ace sol uti on 02 02
TRチーム 【波形⇒画像変換】 LL,LP,RP,RLそれぞれの隣り合う波形の差分をとる⇒CWT変換 通常のスペクトログラム変換より低い周波数をきれいにとってくれるはず。。。 eegs["Fp1"] - eegs["F7"] mean([ spec(fp1-f7), spec(f7-t3),
spec(t3-t5), spec(t5-o1) ])
LL LP RP RL TRチーム 【基本モデル】 波形から変換した画像をtimmモデルに通す timm backbone ⇒
各ラベルの確立(sigmoid)
TRチーム 【序盤】 データによってアノテーター(vote)の数が違う。明らかに2つの山がある。 ⇒votesが少ないデータはラベル付けが荒い? 例えばvotes=3なら、各ラベル0.33333の表現になる(学習が偏りそう) こっちいらんやろ。。。
TRチーム 【序盤】 votes>= 8だけで学習させてみるか。。。 これだけで当時の4位(0.32)
全データで学習(10epochs) 引き続き、votes>=8のみで学習(10epochs) ⇒LB0.26くらい(金圏復帰) 単純なpretraining⇒finetuningではなく、 途中でデータセットを切り替える方法の方が 精度がよかった なんで?⇒LRのチューニングが難しかったぽい TRチーム 【中盤】 とは言え、各チームラベルの偏りに気づき、それぞれLBを上げていく。
⇒モデルの変更、votesが少ないラベルでのpretrainingを実装。 https://www.kaggle.com/competitions/ hms-harmful-brain-activity- classification/discussion/488083
TRチーム 【終盤】 チームマージを経てアンサンブル用モデル作成と同時にシングルモデルを改善 結果として微妙な改善。。。終盤はT88さんのスタッキングの恩恵が大きかった。 _x = x.clone() # LL <=>
RL x[:, 0:4, :, :] = _x[:, 4:8, :, :] x[:, 4:8, :, :] = _x[:, 0:4, :, :] # LP <=> RP x[:, 8:12, :, :] = _x[:, 12:16, :, :] x[:, 12:16, :, :] = _x[:, 8:12, :, :] FLIP 50sec ラベル:10sec ⇒01のattention_channel追加 【他】 specの平均を横にとる 平均ではなくmax-minをとる GeM, multisample-dropout, etc...
P-SHAチーム ・生波形の特性を生かす試み(①、⑤)と、スペクトル変換したもの(②、③、④、⑥)を連結して学習。 ・バックボーンはCNN系を活用。(tf_efficientnetv2_s.in21kとtf_efficientnet_b3.in1k) ・多様な変換方法により、EEGの細かな特性を捉えることができ、精度向上に繋がった。
P-SHAチーム ・様々な変換方法による個別の損失結果を、train lossの計算時に考慮させると、精度向上に寄与。
Stacking シングルモデルを伸ばす方向がネタ切れだったので 単純平均のblendingでスコアの向上が見られたので、アンサンブルを深堀 参考 conv2d stacking model class seizure lpd
gpd lrda grda other 1✕3 kernel class HMSStacking2DCNN(nn.Module): def __init__(self, 6): super().__init__() self.conv2d1 = nn.Conv2d(1, 8, kernel_size=(1,3), padding=0, stride=1) self.conv2d2 = nn.Conv2d(8, 16, kernel_size=(1,3), padding=0, stride=1) self.fc1 = nn.Linear(480, 480) self.dropout1 = nn.Dropout(p=cfg.dropout) self.fc2 = nn.Linear(480, 6) def forward(self, x): x = F.relu(self.conv2d1(x)) x = F.relu(self.conv2d2(x)) x = torch.flatten(x, start_dim=1) x = F.relu(self.fc1(x)) x = self.dropout1(x) x = self.fc2(x) return x ・各モデル✕各クラスの予測値を1channelの画像として入力 ・1✕3 kernelでモデル方向に畳み込み ・単純平均(public:0.24 / private:0.29)に対して stacking(public:0.23 / private:0.28)とスコア向上に寄与
exp LB cv (10seed mean) T88 129 T88 130 T88
131 T88 132 iida 62 iida 78 iida 139 iida 157 iida 160 iida 164 iida 169 eikichi 038 tomo 053 tomo 086 tomo 089 tomo 092 tomo 093 tomo 094 tomo 095 ryushi 002 013 0.23 0.22486 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 012 0.23 0.22498 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 010 0.24 0.22613 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 009 0.23 0.22710 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 007 0.24 0.22828 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 008 0.23 0.22879 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 006 0.23 0.22923 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ Stacking スタッキングに組み込むモデルとハイパラをoptunaでチューニング
exp LB cv (10seed mean) T88 129 T88 130 T88
131 T88 132 iida 62 iida 78 iida 139 iida 157 iida 160 iida 164 iida 169 eikichi 038 tomo 053 tomo 086 tomo 089 tomo 092 tomo 093 tomo 094 tomo 095 ryushi 002 013 0.23 0.22486 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 012 0.23 0.22498 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 010 0.24 0.22613 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 009 0.23 0.22710 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 007 0.24 0.22828 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 008 0.23 0.22879 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 006 0.23 0.22923 ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ Stacking スタッキングに組み込むモデルとハイパラをoptunaでチューニング 山田鐘人・アベツカサ/小学館 「葬送のフリーレン」より