jamesdolezal / slideflow

Deep learning library for digital pathology, with both Tensorflow and PyTorch support.
https://slideflow.dev
GNU General Public License v3.0
230 stars 38 forks source link

Loading pre-extracted feature bags for slide prediction using MIL model in slideflow studio #349

Open sz3029 opened 5 months ago

sz3029 commented 5 months ago

Feature

Currently the MIL extension in slideflow studio redo tile extraction and feature extraction each time for slide predictions, which would take a long time. For robustness, is it possible if we can have an option to load the pre-extracted feature bags of the slides (the tile-extraction parameter is fixed in this case)?

Pitch

When we use the Predict Slide feature, we can have an option to load the paths of the feature bags, like in P.train_mil(). In the _mil_renderer.py file, instead of using _convert_img_to_bag we can directly load the bag (probably using dataset.pt_files(bag)) for the dataset we loaded with the project. Then the bags can be passed to the _predict_bag function when we're making prediction for individual slides.

jamesdolezal commented 5 months ago

This is a great idea! We'll need to put some time into thinking about how to integrate this option into a UI in a way that would be intuitive. But I definitely think it's possible and would be a good enhancement. Will update this issue when we draft together a strategy.