Slideflow

Latest version: v3.0.2

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

Scan your dependencies

Page 4 of 11

2.0.1

This is a *minor*, bug-fix release. See the [Version 2.0 release notes](https://github.com/jamesdolezal/slideflow/releases/tag/2.0.0) for details about the latest major release.

Changelog
- Fix "Dataloader does not contain any batches" error when training MIL models, if the number of slides in a dataset is less than the batch size [248]
- Fix "slideflow.norm has no attribute torch" error when training a PyTorch model without stain normalization [246]
- Add support for systems that cannot save *.zip files (Databricks), via the environmental variable `SF_ALLOW_ZIP=0` [245]
- Fix bug where an error is raised if a slide is missing MPP information, rather than the slide being skipped
- Fix bug when generating SimCLR features
- Fix bug when converting XML ROIs to CSV
- Fix bug where cell segmentation masks could not be loaded if a slide was missing ROIs

2.0

- The deprecated `Dataset.training_validation_split()` function has been removed (use `Dataset.split()`)
- The deprecated `Mosaic.focus()` function has been removed
- The deprecated `expanded`, `tile_zoom`, and `relative_size` arguments for `Mosaic` have been removed

Known Issues
- Slideflow Studio does not yet support multiple-instance learning (MIL) models. MIL support is in development.
- Saliency maps can be generated for multi-categorical models (ie, a single outcome with multiple categorical labels), but not multi-outcome categorical models (multiple outcomes each with different labels).
- Whole-slide cell segmentation may result in grid-like artifacts at areas where segmentation masks were stitched. A fix for this is planned for version 2.1.
- The GAN and MIL functionalities require PyTorch <1.12 and <2.0, respectively.

2.0.0

Highlights

We are very excited to announce the release of Slideflow 2.0, a significant update that maintains the familiar, backwards-compatible programming interface while introducing valuable new features. The changes we've made under the hood have put us in a great position for future expansion as we work to support a broader range of tasks, architectures, and training paradigms.

1.25

For a given sigma, the kernel size is calculated as `int(sigma * 4) + 1`.

To use, add `'b'` to the `augment` hyperparameter string (e.g. `'xyrjb'`), or set `augment=True` to include all augmentations.

Open-Source Solver for Site-Preserved Cross-Validation

Slideflow no longer requires CPLEX for solving site-preserved cross-validation splits, which is proprietary software. Instead, the open-source Pyomo (with Bonmin solver) can now be used for those without access to CPLEX. Slideflow will first attempt to use CPLEX if available.

Other New Features
- Enables L2 regularization for models trained in the PyTorch backend.
- Predictions can now be saved in CSV, feather, or parquet format. The `save_predictions` argument can now be a string to specify save format (`'csv'`, `'feather'`, `'parquet'`). By default, will save in parquet format.
- `Project.predict()`will now save tile, slide, and patient-level predictions.
- More than 10-fold speed improvement when calculating metrics for datasets tens of millions of images in size
- Significant performance improvements for `Dataset` functions, particularly for large projects with tens of thousands of slides
- `sf.io.tensorflow.decode_image()` function now accepts `crop_left`, `crop_width`, `resize_target`, `resize_method`, and `resize_aa` methods for cropping and resizing dataset images. These arguments can be passed as keyword arguments to the `dataset.tensorflow(...)` function.
- New utility function `sf.util.get_model_normalizer()` for easily loading the normalizer used to train a given model.
- Support for feature-conditioned GAN training via `sf.io.torch.LocLabelInterleaver`, an extension of the `InterleaveIterator` class which reads a pandas DataFrame for tile-level labels.
- `sf.stats.metrics_from_dataset()` includes new option `categorical_reduce` which determines how slide/patient-level predictions are determined from tile-level predictions. If 'raw' (default), slide-/patient-level predictions are averages of tile-level predictions. If `onehot`, tile-level predictions are converted to onehot via `argmax` prior to average.
- Adds option for specifying UMAP kwargs to `Project.generate_mosaic()`. For example, `P.generate_mosaic(umap_kwargs={'densmap'=True})`
- New function `sf.util.get_tfrecord_by_location()` enables finding a record in a TFRecord by a given location tuple (x, y)
- New function `DatasetFeatures.to_df()` exports activations into a pandas dataframe
- New function `sf.model.tensorflow.unwrap()` returns the input, post-convolutional output, and model output tensors for the model, for easier model surgery.
- New functions `Dataset.find_slide()` and `Dataset.find_tfrecord()` enable finding slide paths or tfrecord locations from a given slide/patient name.
- Compatibility update for Tensorflow 2.9

Bug Fixes and Other Changes
- Updates Otsu's thresholding method to only apply thresholding to areas within ROIs (if supplied). This helps prevent large pen marks and other artifacts outside ROIs from interfering with the foreground/background threshold calculation.
- Adds `method='pca'` for `SlideMap.neighbors()`
- Allows specifying heatmap `img_format` with `P.generate_heatmaps()`
- Logs warning if a dataset source is supplied to `sf.Dataset` (either manually or via project `settings.json`) and that source does not exist in the dataset configuration JSON file.
- Allows import of Slideflow if pyvips or libvips is not installed.
- Fixes error where logs were not being written to the project folder.
- Fixes training bug when `validate_on_batch` is set to 0 in the pytorch backend
- Corrected logging when testing multiple/single linear outcomes during testing
- Fixes a logging message when generating features
- Fixes bug where, in certain environments, tile extraction would hang if started after pyvips was imported and used in another process.
- Fixes bug where models were not being saved if early stopping was triggered.

Breaking Changes
- Replaces `resolution` argument to `.plot()` with `figsize`, so the matplotlib figsize can be specified directly
- Removes the `buffer` argument to `Heatmap` and `Project.generate_heatmaps()`
- Removes `histogram` argument and functionality from evaluation.
- Renames `SlideMap.export_to_csv()` -> `.to_csv()`
- Renames `SlideMap.save_2d_plot()` -> `.save()`
- Renames `SlideMap.save_3d_plot()` -> `.save_3d()`
- Renames `Mosaic.place_tiles()` -> `.plot()`
- Renames `DatasetFeatures.export_to_torch()` -> `to_torch()`

Patch Notes

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

Page 4 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.