Skip to content

Conversation

@jklubienski
Copy link
Contributor

Adds TIGER TIL regression task to eva using the WSITILS dataset from the TIGER grand challenge (tiger_tils.py), along with a suggested config to run it (tiger_tils.yaml)

Also implements regression metrics and adds extensible support for future regression tasks in the file system.

I realise here that some of the code has been reused from the classification side (e.g. for the embeddings). If the prevailing opinion is that it's best practice to have less duplicate code but make everything slightly less readable file structure-wise this is very easy for me to change.

Testing to come precipitantly.

Copy link
Collaborator

@nkaenzig nkaenzig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍. I left a couple of comments.

Copy link
Collaborator

@nkaenzig nkaenzig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🚀 Left a few last small comments. Last thing missing would be the unit tests as discussed offline.

save_last: ${oc.env:SAVE_LAST, false}
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/MAE}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

monitors val/MAE with mode: max, so checkpoints and early stopping will keep the worst models rather than the best.

head:
class_path: eva.vision.models.networks.ABMIL
init_args:
input_size: ${oc.env:IN_FEATURES, 384}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to set projected_input_size here? (ABMIL doesn't have a default value for that, so instantiation should fail without setting it)

max_samples: *N_PATCHES
width: 224
height: 224
target_mpp: 0.5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This init arg was removed from the tiger dataset class.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz add this config to tests/eva/vision/test_vision_cli.py (at least to test_configuration_initialization, ideally also to test_predict_fit_from_configuration), so we can test for instantiation errors

"""Embeddings dataset class for regression tasks."""

@override
def load_target(self, index: int) -> torch.Tensor:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent Return Types - embeddings.py:13 vs multi_embeddings.py:96
- EmbeddingsRegressionDataset returns torch.Tensor
- MultiEmbeddingsDataset returns npt.NDArray[Any]
- This inconsistency could cause type confusion

import torch
from typing_extensions import override

from eva.core.data.datasets import embeddings as embeddings_base
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: from eva.core.data.datasets import embeddings as base (for conciseness)

_train_split_ratio: float = 0.7
_val_split_ratio: float = 0.15

# target microns per pixel (mpp) for patches.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: usually we comment class attributes like this:

_target_mpp: float = 0.5
```Target microns per pixel (mpp) for patches.```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants