Slideflow

Latest version: v2.3.1

Safety actively analyzes 638773 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 10

1.5.4

Changelog
- Fix bug where whole-slide cell segmentation stalls on some systems when using Libvips backend
- Fix bug when generating features from pretrained ImageNet models in PyTorch backend [242]

1.5.3

Changelog
- Progress bars will now clean up on `KeyboardInterrupt`
- Add error handling if there is insufficient data for evaluation
- Add augment hyperparameter verification step for `sf.ModelParams`
- Fix erroneous `Corrupt or incomplete TFRecord` error raised for any slides that could not have tiles extracted
- Fix bug in SlideMap when calling label_by_slide() multiple times
- Fix bug in `StainNormalizer.jpeg_to_rgb()`
- Fix bug where softmax was being applied to PyTorch linear models with `sf.model.Features`
- Fix bug when training without validation
- Fix bug where mid-training evaluation in Tensorflow used always iterated from the beginning of the validation dataset
- Fix bug with dataset.split() if 'site' is not in annotations

Workbench bug fixes
- Fix heatmap overlay size not being updated during window resize
- Fix stuttering during window resizing
- Fix bug when loading Tensorflow model and `SF_BACKEND=torch`
- Fix bug where models trained on JPEG images would not load when using cuCIM backend
- Show error message in console when a slide, model, or heatmap fails to load
- Show error message that heatmap cannot be loaded if a model is not loaded

1.5.2

Changelog

- Creating a project with the argument `sf.create_project(sources=None)` will prevent creation of the default dataset source in the project root. This is useful for users planning to manually add multiple dataset sources.
- Fix bug where manually providing training/validation datasets to `Project.train()` ran training 3 times, as if k-fold validation was being performed.
- Update SimCLR submodule. `args.json` is now saved in the simclr model folder at the start of training, allowing the user to load intermediate checkpoints with `sf.DatasetFeatures`.

1.5.1

Changelog
- Fix bug where error was raised when using `Dataset.clip()` in PyTorch backend
- Fix bug where Mosaic maps were empty with `Mosaic.plot()`
- [Beta] Add support for arbitrary torchvision transforms, with `Dataset.torch(transforms=...)`
- [Beta] Add CTransPath feature extractor. Use by:

python
ctranspath = sf.model.build_feature_extractor('ctranspath')
ftrs = sf.DatasetFeatures(model=ctranspath, ...)

1.5.0

Self-supervised learning with SimCLR

Self-supervised contrastive learning with SimCLR can now be performed with a Project-level API. See [slideflow.dev/ssl](https://slideflow.dev/ssl) for API and tutorial. Briefly:

python
from slideflow import simclr

Load a project and dataset
P = sf.load_project(...)
dataset = P.dataset(tile_px=299, tile_um=302)

Configure and train SimCLR
args = simclr.get_args(
temperature=0.1,
image_size=299
)
P.train_simclr(args, dataset)


Whole-slide cell segmentation with Cellpose

Whole-slide image cell segmentation can now be performed with a Project-level API. See [slideflow.dev/cellseg](https://slideflow.dev/cellseg) for API and tutorial. Briefly:

python

Load a project
P = sf.Project(...)

Identify and segment cells
P.cell_segmentation(
model='cyto2',
diam_um=10,
window_size=512,
downscale=2
)

Extract image tiles from cell locations
P.extract_cells(
tile_px=96,
tile_um='40x',
apply_masks=True,
grayspace_fraction=1
)


Bayesian hyperparameter optimization improvements

The usability Bayesian hyperparameter optimization functions has been greatly improved. API and tutorials are discussed in [slideflow.dev/trainingbayesian-optimization](https://slideflow.dev/training#bayesian-optimization). Briefly:

python
Load project
P = sf.load_project(...)

Base hyperparameters
hp = sf.ModelParams(tile_px=299, ...)

Configuration space to optimize
config_space = sf.util.shallow_search_space()

Run the Bayesian optimization
best_config, history = P.smac_search(
outcomes='tumor_type',
params=hp,
smac_configspace=cs,
smac_metric='tile_auc',
...
)


Deep and Hyper-deep ensembles

An ensemble of models can be trained with ``Project.train_ensemble()``, only requiring the addition of the keyword argument ``n_ensembles``. Predictions can be generated from ensembles using ``Project.predict_ensemble()``.

Multi-instance learning (CLAM) updates

Several updates are included to improve the verbosity of logging output when training CLAM models.

Revamped documentation

The documentation at https://slideflow.dev has been significantly revamped and expanded.

More flexible mosaic maps
Mosaic maps can now be created from a list of images and coordinates.
They can be used in the same way as previously, providing a `SlideMap`:

python
sm = SlideMap.from_features(...)
mosaic = Mosaic(sm, tfrecords=dataset.tfrecords())


or, you can bypass the need for a SlideMap and tfrecords by providing a list of images and coordinates directly:

python
mosaic = Mosaic(images, coordinates)


Increased flexibility of Dataset creation
- tiles, tfrecords, roi, and slides paths are now optional in a dataset configuration file.
- A `Dataset` object can now be initialized by providing paths to tfrecords, slides, roi and/or tiles via keyword argument. Prior use of providing configuration file and source to `config` and `sources` argument is still valid.

``sf.Mosaic`` API updates
Mosaic maps can now be created from a list of images and coordinates.
They can be used in the same way as previously, providing a `SlideMap`:

python
sm = SlideMap.from_features(...)
mosaic = Mosaic(sm, tfrecords=dataset.tfrecords())


or, you can bypass the need for a SlideMap and tfrecords by providing a list of images and coordinates directly:

python
mosaic = Mosaic(images, coordinates)


``sf.SlideMap`` API updates
- Rename ``SlideMap.save()`` -> ``SlideMap.save_plot()`` (backwards compatibility maintained)
- New ``SlideMap.save()`` function saves both the plot (as previous) and the associated UMAP, if present. Backwards compatibility maintained.
- New ``SlideMap.load()`` class method for loading a ``SlideMap`` / UMAP.
- Remove all use of the cache and recalculate arguments. Instead, use SlideMap.save() and SlideMap.load()
- New ``SlideMap.save_coordinates()`` and ``.load_coordinates()`` for saving only the slidemap coordinates as a parquet pandas dataframe.
- New ``SlideMap.build_mosaic()``
- ``SlideMap.cluster()`` now labels the SlideMap with cluster IDs after generating
- Rename ``SlideMap.from_precalculated()`` -> ``SlideMap.from_xy()``

Other changes
- The naming of variables and attributes throughout Slideflow has been updated to correctly refer to post-softmax network outputs as "predictions" rather than "logits", which actually refers to pre-softmax final layer values.
- Removed unused arguments `manifest` and `patient` to `sf.model.Trainer`
- Add sf.DatasetFeatures.map_predictions(), which returns a SlideMap mapped with the indicated outcomes on X and Y axes
- Add sf.DatasetFeatures.map_activations(), which returns a SlideMap of activations reduced with UMAP
- New ``sf.slide.predict()`` and ``sf.WSI.predict()`` functions for quickly generating model predictions for a single slide
- Rename ``Dataset.train_val_split()`` -> ``.split()``
- Rename ``sf.model.trainer_from_hp()`` -> ``sf.model.build_trainer()``
- Fix bug in documentation where jQuery was not properly loaded

Backwards Incompatible Changes
- **TFRecords now store tile location information (`loc_x` and `loc_y` parameters) in *base* slide dimensions** (ie., at highest magnification). Previously, tile location information was at Region-of-Interest scale (1/10th the highest magnification). This change makes the tile location information more accurate (which was required for the cell segmentation pipeline), but it means that **TFRecords should be regenerated with version 1.5.0** and should not be mixed between Slideflow versions when location information is being used.

1.4.4

Page 4 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.