TReNDSコンペ振り返り

kaggle の TReNDS Neuroimaging コンペに参戦したので、振り返ります。

www.kaggle.com

はじめに

結果から言うと、無事金メダルを獲得することができました。

solution は以下にあります。

www.kaggle.com

コンペの概要

予測対象:年齢とその他4つの数値(数値の内容については非公開)

評価指標:feature-weighted, normalized absolute errors

注意事項:

個人情報保護などの観点から train data の予測対象は少し加工されているとのこと

The scores (see train_scores.csv) are not the original age and raw assessment values. They have been transformed and de-identified to help protect subject identity and minimize the risk of unethical usage of the data. Nonetheless, they are directly derived from the original assessment values and, thus, associations with the provided features is equally likely.

Before transformation, the age in the training set is rounded to nearest year for privacy reasons. However, age is not rounded to year (higher precision) in the test set. Thus, heavily overfitting to the training set age will very likely have a negative impact on your submissions.

また train data には site1 のデータしかないが、test data には site2 のデータもあるとのこと

Models are expected to generalize on data from a different scanner/site (site 2). All subjects from site 2 were assigned to the test set, so their scores are not available. While there are fewer site 2 subjects than site 1 subjects in the test set, the total number of subjects from site 2 will not be revealed until after the end of the competition. To make it more interesting, the IDs of some site 2 subjects have been revealed below. Use this to inform your models about site effects. Site effects are a form of bias. To generalize well, models should learn features that are not related to or driven by site effects.

データ

  • fMRI_train - a folder containing 53 3D spatial maps for train samples in .mat format
  • fMRI_test - a folder containing 53 3D spatial maps for test samples in .mat format
  • fnc.csv - static FNC correlation features for both train and test samples
  • loading.csv - sMRI SBM loadings for both train and test samples
  • train_scores.csv - age and assessment values for train samples

  • sample_submission.csv - a sample submission file in the correct format

  • reveal_ID_site2.csv - a list of subject IDs whose data was collected with a different scanner than the train samples
  • fMRI_mask.nii - a 3D binary spatial map
  • ICN_numbers.txt - intrinsic connectivity network numbers for each fMRI spatial map; matches FNC names

チームマージ前

とりあえず LGB でベースライン作成

www.kaggle.com

CV: 0.1628 - LB: 0.162 と初期は CV と LB が一致するコンペだとか思っていました。

そして段々とハイスコアカーネルが出てきたので、それらをもとにブレンドしたものをサブミットしてみたところ、CV: 0.1581 - LB: 0.1593 という結果が出て、データ概要欄を改めて確認すると、train data の予測対象は少し加工されていると知りました。

この CV と LB の乖離の原因は、test data には train data にはない site2 が存在することの他に、この train data の予測対象の加工が少し関わっているのかなと思いつつ、ここで 3D map を使っている方々が上位にいるということに改めて気づき、ここで 3D map を使った NN を準備だけしてブレンドしていなかったので(CVが低かった)、ブレンドしてみると微動だにしなかった LB がようやく更新されます。

(チームマージありかもなんて呟いてますがこのあとにソロで行くとか呟きます)

そして NN 単体の精度をあげて NN の精度を確認してみると、CV: 0.1596 - LB: 0.1591と、3D map を使うことで CV と LB の乖離が抑えられることがわかりました。

NN は少しだけ時間がかかるので検証モデルを Ridge に乗り換え、CV: 0.1583 - LB: 0.1583 と LB が CV についていく形で順調にスコアが上がります。

(ソロで行くなんて呟いてますがこのあとにチームマージします)

チームマージ後

海外勢の Lightさん とチームを組むことにしました。

というのも、今回チームを組んでくださった Lightさん は 3D map 以外のところでスコアを上げているらしく、External Data Thread を見て 3D map で成功しているっぽい僕に声をかけたということでした。こちらとしては 3D map 以外のところでスコアを上げる糸口が見つかっていなかったので、お互いに win-win なチームマージになりました。

あとはお互いのアプローチを組み合わせて、改善できるところは改善して、以下のような solution になりました。最終的に NN を post-process なしで CV: 0.1578, LB: 0.1578 辺りまで改善出来たのが個人的に嬉しかったです。

f:id:NmaViv:20200702073439p:plain

最後に pseudo labeling も試しましたが、CV は改善するものの、train data に overfitting したのか LB は改善しませんでした。 

学んだこと

  • データの説明を読むのは大事(当たり前)
  • train と test で一癖あるとき post-process は大事
  • チームマージは偉大

終わりに

Bengaliコンペとionコンペで残念な結果に終わっていたので、ここで挽回して金メダルを取ることができて良かったです!

kaggleランクも自己ベスト更新してました(嬉しい)。

f:id:NmaViv:20200702063042p:plain