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
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
500
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
110
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
380
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
プロポーザルを書いてもらう
pvcresin
0
300
Google Apps Script で Ruby を動かす
kawahara
0
140
源内ハンズオン概要編
hideg
0
140
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
460
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
160
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Ethics towards AI in product and experience design
skipperchong
2
340
Facilitating Awesome Meetings
lara
57
7.1k
GitHub's CSS Performance
jonrohan
1033
470k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Unsuck your backbone
ammeep
672
58k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
450
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
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でチューニング 山田鐘人・アベツカサ/小学館 「葬送のフリーレン」より