birkhoffkiki / GPFM

The official implementation of GPFM
39 stars 1 forks source link

Questions about pretraining #5

Closed boqchen closed 1 month ago

boqchen commented 1 month ago

Hi,

Thanks for the great project. I have a few questions about the pretraining.

  1. Do I need to extract patches from WSI for pretraining? If so, how should the data look like, e.g., in h5 file etc.
  2. How long does the training takes on your dataset?

Thanks in advance!

birkhoffkiki commented 1 month ago
  1. If you use our released pretrained weights, then no. If you would like to pretrain the foundation model on your own data, it depends on the size of dataset. In our experiments, it takes about 1week for 2 H800 nodes (8 GPUs per node). In our setting, we extract 512*512 images from level 0.
  2. For downstream tasks, it is very fast. may be few ours
boqchen commented 1 month ago

Thanks for your prompt reply.

How do you save these 512x512 patches? I would expect them to be 10s of millions if not hundreds. Do you just save them in one folder as png files etc. or is there a more efficient way to save them so it speeds up the training.

birkhoffkiki commented 1 month ago

The file structure is similar to following lines: ├── ACROBAT2023 (dataset name) │   ├── images │   │   ├── 100_ER (slide name) │   │   │ ├── x_y_size_size.jpg (pathc name)

Then we built an index for all files, and saved them into a json file: {"slide_name": [path1, path2, ....], xxxx } to read data, read the json first, and then iterate all paths