Package: keras-unet-collection
keras-unet-collectionThetensorflow.kerasimplementation of U-net, V-net, U-net++, UNET 3+, Attention U-net, R2U-net, ResUnet-a, U^2-Net, TransUNET, and Swin-UNET with optional ImageNet-trained backbones.keras_unet_collection.modelscontains functions that configure keras models with hyper-parameter options.Pre-trained ImageNet backbones are supported for U-net, U-net++, UNET 3+, Attention U-net, and TransUNET.Deep supervision is supported for U-net++, UNET 3+, and U^2-Net.See theUser guidefor other options and use cases.keras_unet_collection.modelsNameReferenceunet_2dU-netRonneberger et al. (2015)vnet_2dV-net (modified for 2-d inputs)Milletari et al. (2016)unet_plus_2dU-net++Zhou et al. (2018)r2_unet_2dR2U-NetAlom et al. (2018)att_unet_2dAttention U-netOktay et al. (2018)resunet_a_2dResUnet-aDiakogiannis et al. (2020)u2net_2dU^2-NetQin et al. (2020)unet_3plus_2dUNET 3+Huang et al. (2020)transunet_2dTransUNETChen et al. (2021)swin_unet_2dSwin-UNETHu et al. (2021)Note: the two Transformer models are incompatible withNumpy 1.20;NumPy 1.19.5is recommended.keras_unet_collection.basecontains functions that build the base architecture (i.e., without model heads) of Unet variants for model customization and debugging.keras_unet_collection.baseNotesunet_2d_base,vnet_2d_base,unet_plus_2d_base,unet_3plus_2d_base,att_unet_2d_base,r2_unet_2d_base,resunet_a_2d_base,u2net_2d_base,transunet_2d_base,swin_unet_2d_baseFunctions that accept an input tensor and hyper-parameters of the corresponded model, and produce output tensors of the base architecture.keras_unet_collection.activationsandkeras_unet_collection.lossesprovide additional activation layers and loss functions.keras_unet_collection.activationsNameReferenceGELUGaussian Error Linear Units (GELU)Hendrycks et al. (2016)SnakeSnake activationLiu et al. (2020)keras_unet_collection.lossesNameReferencediceDice lossSudre et al. (2017)tverskyTversky lossHashemi et al. (2018)focal_tverskyFocal Tversky lossAbraham et al. (2019)ms_ssimMulti-scale Structural Similarity Index lossWang et al. (2003)iou_segIntersection over Union (IoU) loss for segmentationRahman and Wang (2016)iou_box(Generalized) IoU loss for object detectionRezatofighi et al. (2019)triplet_1dSemi-hard triplet loss (experimental)crps2d_tfCRPS loss (experimental)Installation and usagepip install keras-unet-collectionfromkeras_unet_collectionimportmodels# 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]. SeeKeras Applicationsfor details.Note: Neural networks produced by this package may contain customized layers that are not part of the Tensorflow. It is reommended to save and load model weights.ChangelogExamplesJupyter notebooks are provided asexamples:Attention U-net with VGG16 backbone[link].UNET 3+ with deep supervision, classification-guided module, and hybrid loss[link].Vision-Transformer-based examples are in progress, and available atkeras-vision-transformerDependenciesTensorFlow 2.5.0, Keras 2.5.0, Numpy 1.19.5.(Optional for examples) Pillow, matplotlib, etc.OverviewU-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.ContactYingkai (Kyle) Sha <yingkai@eoas.ubc.ca> <yingkaisha@gmail.com>LicenseMIT LicenseCitationSha, Y., 2021: Keras-unet-collection. GitHub repository, accessed 4 September 2021,https://doi.org/10.5281/zenodo.5449801@misc{keras-unet-collection,
  author = {Sha, Yingkai},
  title = {Keras-unet-collection},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/yingkaisha/keras-unet-collection}},
  doi = {10.5281/zenodo.5449801}
}