Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mducducd
Copy link
Collaborator

@mducducd mducducd commented Oct 20, 2025

Stamp v2.4

  • Add support for regression and survival analysis tasks.
    • Regression with MAE loss.
    • Cox-based survival analysis, currently supporting title-level training.
  • Add TransMIL (NeurIPS 2021) as a new attention-based model.
  • Training now supports optional backbones: Attention (ViT), TransMIL, and MLP.
  • All backbone types can perform tile-level or patient-level modeling by automatic ModelClass initialization based on feature type and task.
  • Add new statistics: Regression → R², Pearson r, Pearson p, MAE, RMSE. Survival → Kaplan–Meier curve, log-rank p-value, C-index.
  • Added probability heatmaps for regression and survival analysis.

@mducducd
Copy link
Collaborator Author

I found that regression and survival heatmaps are meaningless without determining gradient range.
So min and max prediction values from training need to be saved to the model, serving for heatmap and especially getting the cut_off for survival statistics.

@mducducd
Copy link
Collaborator Author

mducducd commented Nov 6, 2025

I’ve added both slide-level and patient-level support for regression and survival tasks (only mlp can be trained). Just a few more steps are needed to add tests.

Copy link
Contributor

@s1787956 s1787956 left a comment

Choose a reason for hiding this comment

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

I am very happy, great job Duc! I think we can merge tomorrow.

# Sample count for training
log_total_class_summary(patient_to_data, categories)

# Stratified split

Choose a reason for hiding this comment

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

The stratified split is also needed for survival, the variable for the StratifiedKFold should be the event marker. I did not see it in the code, make sure that the stratification variable for survival is set

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing it out. I have just added it and also strengthened event labels handling.

@mducducd
Copy link
Collaborator Author

Can we merge it today? I will release it as 2.4 :)

@mducducd mducducd merged commit 95e6a10 into main Nov 26, 2025
28 checks passed
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.

4 participants