DEV Community

kito2718
kito2718

Posted on

BCT1: Kaggle Environment Setup and First Submission

Eye Catch Image
Biohub - Cell Tracking During Development

Abstract

  • Participating in the biological image competition "Biohub - Cell Tracking During Development" on Kaggle.
  • A summary of steps from setting up the execution environment on Kaggle Notebooks to making your first submission.
  • Environment: Windows 11.

Introduction and Background

I am taking on my first active Kaggle competition! I have never done life sciences before, but I feel an intense motivation that this will be useful to society. I have occasionally seen TV documentaries showing cell division and movement, and this competition involves exactly that kind of data. Essentially, the task is to detect cell locations(nodes)from spatiotemporal 3D microscope images and link them across frames. My motivation is to challenge myself with something complex like "how AI relates to this" and use it to upgrade my skills.

The data size is extremely large. However, Kaggle Notebooks provides free GPU slots, so I decided to set up my development environment there. I plan to set up a local PC environment later as needed.

Kaggle Notebook Setup Steps

1. Development Environment Setup & Preparation

To participate in this competition, you need a few preparations:

(1)Agree to the Competition Rules:
Go to the Biohub - Cell Tracking During Development page, click the "Join Competition" button, and agree to the terms. If you do not do this, you cannot download data or submit predictions.

(2)Get Kaggle API Token:
Click "Create New Token" on your Kaggle Account Settings page to download the kaggle.json file. This is useful when submitting from a local environment or using the CLI. You can place it under your user directory:

C:\user\xxx\.kaggle\kaggle.json
Enter fullscreen mode Exit fullscreen mode

(3)Create a Kaggle Notebook:
Go to the Code tab and press "New Notebook" to generate one.

(4)Open the Template Notebook:
The notebook content is published here. It is easiest to start by clicking "Copy and Edit":
https://www.kaggle.com/code/aaaa1597/biocell-track-by-hgs

[!CAUTION]
Warning: import zarr fails!
Kaggle does not pre-install zarr, so we must install it separately. However, during the final submission, we must set "Internet" to off. Because of this, we cannot simply write !pip install zarr in our notebook(it will fail during submission evaluation).

I have summarized how to resolve this in the next article:
BCT2: Installing Custom Packages Offline (Please check it out!)


2. Run All

Once your notebook is ready, run it to verify that no errors occur.
Press the "Run All" button.

The progress will be shown in the bottom-left popup. It takes about 10 minutes, so take a break and wait.


3. Save Version

After "Run All" completes successfully, save your notebook by clicking "Save Version".
Select the options and save. The notebook will run all cells again in the background. You can track this progress in the bottom-left popup as well.

       ↓

4. Submit to Competition

Open the version history, select the successful run, and click "Submit to competition" (as shown below).

Then, click the "Submit" button to finalize.


5. Verify Results

Go to the Submissions page to verify the status.

For example, Version 7 succeeded, whereas Version 6 failed. Version 6 failed because the output file format did not match the submission requirements. After fixing the formatting bugs and running "Run All" again, it went through successfully.

This completes the first submission! From here, the cycle of score optimization begins. Good luck!


Summary

We have successfully verified that our notebook can make a valid submission. Using this baseline as a starting point, we can now move on to applying more advanced 3D cell detection models(such as Cellpose or StarDist)and tracking algorithms(such as Kalman filters or network flows).

First Submission Code

The first submission code is available in this Gist:
@gist

Japanese Version of This Series

You can read the original Japanese version of this article on Zenn:

Conclusion

I hope this helps!

Top comments (0)