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
5.9k
レコメンドコンペ入門
t88
1
1.5k
Other Decks in Programming
See All in Programming
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
250
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
770
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
280
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
180
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
350
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
700
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
270
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.1k
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
790
Inside Stream API
skrb
1
730
Claspは野良GASの夢をみるか
takter00
0
190
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
140
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
390
Everyday Curiosity
cassininazir
0
230
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to Ace a Technical Interview
jacobian
281
24k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Bash Introduction
62gerente
615
220k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
Fireside Chat
paigeccino
42
4k
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でチューニング 山田鐘人・アベツカサ/小学館 「葬送のフリーレン」より