Downloads · 30 days
25
11% of all-time downloads
Himel000/kidney-tumor-efficientnetb4
kidney-tumor-efficientnetb4 is a image classification model from Himel000. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
This model classifies kidney CT scan images into four categories using EfficientNetB4 with transfer learning and a custom classification head. It is part of the Kidney Tumor Identification System — a production-ready,…
Downloads · 30 days
25
11% of all-time downloads
All-time downloads
233
Public
Repo size
78.9 MB
Likes
0
Public
Click a slice to open those files.
.keras78.9 MB · 100%
From the Hugging Face model README
This model classifies kidney CT scan images into four categories using EfficientNetB4 with transfer learning and a custom classification head. It is part of the Kidney Tumor Identification System — a production-ready, explainable AI application for medical image analysis.
⚠️ Medical Disclaimer: This model is intended for research and educational purposes only. It is NOT a clinical diagnostic tool. Always consult a qualified radiologist or physician for medical decisions.
| Property | Value |
|---|---|
| Architecture | EfficientNetB4 + Custom Classification Head |
| Input Size | 380 × 380 × 3 |
| Output Classes | 4 (Cyst, Normal, Stone, Tumor) |
| Pretrained Weights | ImageNet |
| Framework | TensorFlow / Keras |
| Training Strategy | Two-phase transfer learning |
| Preprocessing | tf.keras.applications.efficientnet.preprocess_input |
Input (380, 380, 3)
↓
EfficientNetB4 (frozen in phase 1, last 4 layers unfrozen in phase 2)
↓
GlobalAveragePooling2D
↓
BatchNormalization
↓
Dropout (0.3)
↓
Dense (4, softmax) → [Cyst, Normal, Stone, Tumor]
| Class | Count |
|---|---|
| Normal | 5,077 |
| Cyst | 3,709 |
| Tumor | 2,283 |
| Stone | 1,377 |
| Parameter | Phase 1 | Phase 2 |
|---|---|---|
| Epochs | 10 | 20 |
| Learning Rate | 0.001 | 0.0001 |
| Batch Size | 32 | 32 |
| Base Model | Frozen | Last 4 layers unfrozen |
| Optimizer | Adam | Adam |
| Loss | Categorical Crossentropy | Categorical Crossentropy |
| Metric | Value | Threshold |
|---|---|---|
| Validation Accuracy | 99.46% | — |
| Test Accuracy | 85.36% | — |
| Test AUC-ROC | 98.38% | ≥ 90% ✅ |
| Test Sensitivity | 85.36% | ≥ 85% ✅ |
| Test Specificity | 95.00% | — |
| Test F1 Score | 85.25% | — |
Evaluation Gate: Model is only pushed to production if AUC-ROC ≥ 0.90 AND Sensitivity ≥ 0.85. This gate is enforced automatically in the CI/CD pipeline.
All training runs are logged on DagsHub: 🔗 https://dagshub.com/himelds/kidney-tumor-identification-system.mlflow
from huggingface_hub import hf_hub_download
import tensorflow as tf
import numpy as np
from PIL import Image
# Load model
model_path = hf_hub_download(
repo_id="Himel000/kidney-tumor-efficientnetb4",
filename="model.keras"
)
model = tf.keras.models.load_model(model_path)
# Class names (model output order)
CLASS_NAMES = ["Cyst", "Normal", "Stone", "Tumor"]
# Preprocess image
def preprocess(image_path):
img = Image.open(image_path).convert("RGB").resize((380, 380))
arr = np.array(img, dtype=np.float32)
arr = tf.keras.applications.efficientnet.preprocess_input(arr)
return np.expand_dims(arr, axis=0)
# Predict
image = preprocess("ct_scan.jpg")
predictions = model.predict(image)
predicted_class = CLASS_NAMES[np.argmax(predictions)]
confidence = float(np.max(predictions))
print(f"Prediction: {predicted_class} ({confidence:.2%} confidence)")
import requests
response = requests.post(
"https://himel000-kidney-tumor-api.hf.space/api/v1/predict",
files={"file": open("ct_scan.jpg", "rb")}
)
result = response.json()
print(f"Class: {result['predicted_class']}")
print(f"Confidence: {result['confidence']:.2%}")
print(f"Uncertain: {result['is_uncertain']}")
# result also contains: gradcam_base64, probabilities, uncertainty_score
👉 https://kidney-tumor-identification-system.streamlit.app/
This model is deployed with full explainability support:
If you use this model in your research, please cite:
@software{das2026kidney,
author = {Das, Himel},
title = {Kidney Tumor Identification System},
year = {2026},
url = {https://github.com/himelds/kidney-tumor-identification-system},
note = {EfficientNetB4-based CT scan classifier with Grad-CAM explainability}
}
Dataset citation:
@dataset{islam2022kidney,
author = {Islam, Nazmul},
title = {CT KIDNEY DATASET: Normal-Cyst-Tumor and Stone},
year = {2022},
publisher = {Kaggle},
url = {https://www.kaggle.com/datasets/nazmul0087/ct-kidney-dataset-normal-cyst-tumor-and-stone}
}
Himel Das
MIT License — see LICENSE for details.