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
3Dシーンの圧縮
fadis
1
670
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
660
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
450
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
4.7k
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
160
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
240
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.3k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
240
Modding RubyKaigi for Myself
yui_knk
0
900
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
150
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
130
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Raft: Consensus for Rubyists
vanstee
141
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
How to train your dragon (web standard)
notwaldorf
97
6.7k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Docker and Python
trallard
47
3.9k
Facilitating Awesome Meetings
lara
57
6.9k
Making Projects Easy
brettharned
120
6.7k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.3k
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でチューニング 山田鐘人・アベツカサ/小学館 「葬送のフリーレン」より