Image Segmentation
Keras
English
histology
pathology
vision
kidney
transplantation
Masson's trichrome
Instructions to use bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant: direct link, hf CLI and curl.
- Browser
- Download file 2.91 kB
-
https://huggingface.co/bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant/resolve/main/README.md
- Command line
-
hf download hf://bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant/resolve/main/README.md
2.91 kB
| license: cc-by-nc-sa-4.0 | |
| language: | |
| - en | |
| pipeline_tag: image-segmentation | |
| library_name: keras | |
| tags: | |
| - histology | |
| - pathology | |
| - vision | |
| - kidney | |
| - transplantation | |
| - Masson's trichrome | |
| # Model Card for EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant | |
| ## Requesting Access | |
| Access is granted only to users whose Hugging Face primary email matches their institutional/academic email. Requests from personal domains (e.g., @gmail, @hotmail) will be declined. | |
| ## Model Description | |
| - **Developed by:** Bertrand Chauveau, Bordeaux University Hospital | |
| - **Model type:** Keras segmentation model, DeepLabv3+ architecture with an EfficientNetV2S backbone, channels last | |
| - **Task:** semantic segmentation of interstitial fibrosis in kidney transplant biopsies | |
| - **Dataset:** Trained on green Masson's trichrome, RGB tile 512 x 512 pixels at a resolution around 1 μm/pixel | |
| - **Input:** shape (batch_size, 512, 512, 3), raw pixel values 0.-255. as float32 | |
| - **Repository:** https://github.com/bertrandchauveau/FIAT_DL | |
| - **Paper:** pending | |
| - **License:** cc-by-nc-sa-4.0 | |
| ## Intended Use & Limitations | |
| ### Intended Use | |
| This model is intended for automated segmentation of fibrosis in kidney transplant histopathology slides for research purposes. | |
| ### Limitations | |
| * **Research use only** | |
| * **Stain specificity:** The model was trained specifically on green Masson's trichrome slides from Bordeaux University Hospital | |
| ## How To Use | |
| **Load model** | |
| ```python | |
| import os | |
| os.environ["KERAS_BACKEND"] = "torch" # or "jax" or "tensorflow" | |
| import keras | |
| from huggingface_hub import login | |
| login() # login with your User Access Token, found at https://huggingface.co/settings/tokens | |
| #load model | |
| model = keras.saving.load_model("hf://bertrandchauveau/EffNetV2S_DLV3_512_interstitial_fibrosis_kidney_transplant") | |
| ``` | |
| **Inference** | |
| ```python | |
| from keras.utils import img_to_array, load_img | |
| import numpy as np | |
| img_size = (512, 512) | |
| threshold = 0.35 #recommended threshold value | |
| #get an example image | |
| !wget https://raw.githubusercontent.com/bertrandchauveau/FIAT_DL/main/example_tile.jpg | |
| #image to array | |
| img_array = img_to_array(load_img('example_tile.jpg', target_size=img_size)) | |
| img_batch = np.expand_dims(img_array, axis=0) #expects shape (batch, 512, 512, 3) and float32 values 0-255 | |
| #prediction | |
| pred = model.predict(img_batch)[0] #shape (1,512,512,2) to (512,512,2) | |
| mask = np.where(pred[...,1] >= threshold, 255, 0).astype(np.uint8) #pred[...,1] is the score of fibrosis, 0 of "non-fibrosis" | |
| ``` | |
| ## Software Dependencies | |
| **Python Packages** | |
| - keras>3.0 | |
| ## Contact | |
| For any additional questions or comments, contact Bertrand Chauveau (`bertrand.chauveau@chu-bordeaux.fr`) | |
| --- | |
| library_name: keras | |
| --- | |
| This model has been uploaded using the Keras library and can be used with JAX, | |
| TensorFlow, and PyTorch backends. | |
| For more details about the model architecture, check out | |
| [config.json](./config.json). |