The Tensorflow, Keras implementation of U-net, V-net, U-net++, R2U-net, Attention U-net, ResUnet-a, U^2-Net, and UNET 3+ with optional ImageNet-trained backbones.
Project description
keras-unet-collection
The tensorflow.keras
implementation of U-net, V-net, U-net++, R2U-net, Attention U-net, ResUnet-a, U^2-Net, and UNET 3+ with optional ImageNet-trained backbones.
keras_unet_collection.models
contains functions that configure keras models with hyper-parameter options.
- Pre-trained ImageNet backbones are supported for U-net, U-net++, Attention U-net, and UNET 3+.
- Deep supervision is supported for U-net++, UNET 3+, and U^2-Net.
- See the User guide for other options and use cases.
keras_unet_collection.models |
Name | Reference |
---|---|---|
unet_2d |
U-net | Ronneberger et al. (2015) |
vnet_2d |
V-net (modified for 2-d inputs) | Milletari et al. (2016) |
unet_plus_2d |
U-net++ | Zhou et al. (2018) |
r2_unet_2d |
R2U-Net | Alom et al. (2018) |
att_unet_2d |
Attention U-net | Oktay et al. (2018) |
resunet_a_2d |
ResUnet-a | Diakogiannis et al. (2020) |
u2net_2d |
U^2-Net | Qin et al. (2020) |
unet_3plus_2d |
UNET 3+ | Huang et al. (2020) |
keras_unet_collection.base
contains functions that build the base architecture (i.e., without model heads) of Unet variants for model customization and debugging.
keras_unet_collection.base |
Notes |
---|---|
unet_2d_base , vnet_2d_base , unet_plus_2d_base , r2_unet_2d_base , att_unet_2d_base , resunet_a_2d_base , u2net_2d_base , unet_3plus_2d_base |
Functions that accept an input tensor and hyper-parameters of the corresponded model, and produce output tensors of the base architecture. |
keras_unet_collection.activations
and keras_unet_collection.losses
provide additional activation layers and loss functions.
keras_unet_collection.activations |
Name | Reference |
---|---|---|
GELU |
Gaussian Error Linear Units (GELU) | Hendrycks et al. (2016) |
Snake |
Snake activation | Liu et al. (2020) |
keras_unet_collection.losses |
Name | Reference |
---|---|---|
dice |
Dice loss | Sudre et al. (2017) |
tversky |
Tversky loss | Hashemi et al. (2018) |
focal_tversky |
Focal Tversky loss | Abraham et al. (2019) |
triplet_1d |
Semi-hard triplet loss (experimental) | |
crps2d_tf |
CRPS loss (experimental) |
Installation and usage
pip install keras-unet-collection
from keras_unet_collection import models
# e.g. models.unet_2d(...)
-
Note: Currently supported backbone models are:
VGG[16,19]
,ResNet[50,101,152]
,ResNet[50,101,152]V2
,DenseNet[121,169,201]
, andEfficientNetB[0-7]
. See Keras Applications for details. -
Note: This package is planned for major updates. For versions prior to 0.1.0, backward compatibility is not ensured.
-
Note: Neural networks produced by this package may not be compatible with other pre-trained models of the same name. Training from scratch is recommended.
-
Jupyter notebooks are provided as examples:
Dependencies
-
TensorFlow 2.3.0, Keras 2.4.0, Numpy 1.18.2.
-
(Optional for examples) Pillow, matplotlib, etc.
Overview
U-net is a convolutional neural network with encoder-decoder architecture and skip-connections, loosely defined under the concept of "fully convolutional networks." U-net was originally proposed for the semantic segmentation of medical images and is modified for solving a wider range of gridded learning problems.
U-net and many of its variants take three or four-dimensional tensors as inputs and produce outputs of the same shape. One technical highlight of these models is the skip-connections from downsampling to upsampling layers, which benefit the reconstruction of high-resolution, gridded outputs.
Contact
Yingkai (Kyle) Sha <yingkai@eoas.ubc.ca> <yingkaisha@gmail.com>
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for keras-unet-collection-0.0.18.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09ba210814d196ad2f4ef816da9be53f034160aaf8c60bf9d3192e0cfe1dcd2d |
|
MD5 | d4ed9611db560385cfa6aba756a7a149 |
|
BLAKE2b-256 | 2d7b8f14ea29a6b1a5c832f39b7403ba8e89403bfb08338498061957f61f1e97 |
Hashes for keras_unet_collection-0.0.18-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c7b25346d7abb6269c9f1dcd0e16a8d94dabca281abfa643602db3c1051f15 |
|
MD5 | 68635abea93bef852a9539c21d005ff6 |
|
BLAKE2b-256 | 12b747589858fb6c52128017e5cc1353fe61a09da8ff3aa5cff9aa619da8af62 |