szc19990412 / TransMIL

TransMIL: Transformer based Correlated Multiple Instance Learning for Whole Slide Image Classification
325 stars 72 forks source link

What is the number of patches of each WSIs? #20

Closed Tonyboy999 closed 1 year ago

Tonyboy999 commented 1 year ago

Some WSIs have only 2048 patches, some have over 40000 patches. In your paper, you used a Squaring method to pad the embeddings to a fixed length. What is the fixed length? If the largest WSI has 50000 patches, did you pad all the embeddings to (1, 50000, 1024) ?

szc19990412 commented 1 year ago

We process it at 20x resolution, and we tend to get only about 20,000 patches at most in WSI. For example, if a WSI has only 2048 patches, we will pad the embeddings to (1, 2116, 1024), and if a WSI has 50,000 patches, we will pad the embeddings to (1, 50176, 1024). The amount of padding is determined by the number of patches in the WSI itself.

Tonyboy999 commented 1 year ago

Thank you for your reply! But I can't understand your reply.

The amount of padding is determined by the number of patches in the WSI itself. How did you determine the padding with the number of patches in the WSI?

I can't see any logic in padding 2048 -> 2116 and 50000 -> 50176. @szc19990412

zhiyyyu commented 1 year ago

Maybe 2116 means 46*46, and 50176 means 224*224. Later in the PPEG, patch tokens will be reshaped into ( $\sqrt{N}$, $\sqrt{N}$ ).

HHHedo commented 1 year ago

We process it at 20x resolution, and we tend to get only about 20,000 patches at most in WSI. For example, if a WSI has only 2048 patches, we will pad the embeddings to (1, 2116, 1024), and if a WSI has 50,000 patches, we will pad the embeddings to (1, 50176, 1024). The amount of padding is determined by the number of patches in the WSI itself.

Thank you for your reply! In the process of spatial restoration, did you use the spatial coordinate of patches?