File size: 5,052 Bytes
9b87cad |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
---
license: apache-2.0
language:
- en
tags:
- medical-imaging
- kidney-disease
- ct-scan
- image-classification
- pytorch
- efficientnet
- custom-cnn
metrics:
- accuracy
- f1
library_name: pytorch
pipeline_tag: image-classification
datasets:
- nazmul0087/ct-kidney-dataset-normal-cyst-tumor-and-stone
---
# Kidney Ct Classifier Efficientnet
## Model Description
Custom EfficientNet-style CNN for kidney CT scan classification (101M params, 95%+ accuracy)
This is a custom EfficientNet-style CNN trained from scratch for kidney CT scan classification. The model classifies kidney CT images into 4 categories: Cyst, Normal, Stone, and Tumor.
## Model Details
- **Model Type:** Custom EfficientNet-style Convolutional Neural Network
- **Architecture:** 101M parameters, 7 stages with MBConv blocks
- **Input Resolution:** 384x384x3 RGB images
- **Number of Classes:** 4 (Cyst, Normal, Stone, Tumor)
- **Framework:** PyTorch 2.0+
- **Training Precision:** BF16 mixed precision on NVIDIA A100
- **No Pretrained Weights:** Trained from scratch on medical imaging data
## Performance
### Test Set Results
- **Accuracy:** 95.00%
- **F1-Score:** 0.9400
### Per-Class Performance
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| Cyst | High | High | High |
| Normal | High | High | High |
| Stone | Good | Good | Good |
| Tumor | Good | Good | Good |
## Training Details
The model was trained on the CT Kidney Dataset with the following approach:
- Custom EfficientNet-style architecture built from scratch
- 101 million trainable parameters
- Width multiplier: 1.4, Depth multiplier: 1.4
- Input resolution: 384x384 pixels
- BF16 mixed precision training on NVIDIA A100
- AdamW optimizer with OneCycleLR scheduler
- Extensive data augmentation (5x multiplication)
- No data leakage: splits created before augmentation
- Training time: 10.5 hours on A100 40GB
### Training Configuration
- **Epochs:** 40
- **Batch Size:** 48
- **Optimizer:** AdamW (lr=2e-3, weight_decay=2e-4)
- **Scheduler:** OneCycleLR with cosine annealing
- **Loss Function:** CrossEntropyLoss with label smoothing (0.1)
- **Regularization:** Dropout (0.35), Stochastic Depth (0-0.2)
- **Data Augmentation:** Extensive augmentation including rotation, flip, brightness/contrast, CLAHE
- **Hardware:** NVIDIA A100 40GB with BF16 precision
- **Training Time:** ~10.5 hours for 40 epochs
### Data Split
- **Training:** 80% (augmented to ~78,000 images)
- **Validation:** 10% (original, no augmentation)
- **Testing:** 10% (original, no augmentation)
- **No Data Leakage:** Splits created before augmentation
## Intended Use
### Primary Use Cases
- Medical research and educational purposes
- Kidney disease classification from CT scans
- Computer-aided diagnosis (CAD) system development
- Medical imaging research
### Limitations
- Model trained on specific dataset distribution
- Should not be used as sole diagnostic tool
- Requires clinical validation before medical use
- Performance may vary on images from different scanners or protocols
## How to Use
### Installation
```bash
pip install torch torchvision pillow
```
### Inference Example
```python
import torch
from PIL import Image
from torchvision import transforms
# Load model
model = torch.load('model.pth')
model.eval()
# Prepare image
transform = transforms.Compose([
transforms.Resize((384, 384)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
# Predict
image = Image.open('kidney_ct.jpg').convert('RGB')
image_tensor = transform(image).unsqueeze(0)
with torch.no_grad():
output = model(image_tensor)
probs = torch.softmax(output, dim=1)
pred = output.argmax(1).item()
classes = ['Cyst', 'Normal', 'Stone', 'Tumor']
print(f"Prediction: {classes[pred]} ({probs[0][pred].item()*100:.1f}% confidence)")
```
## Dataset
**Name:** nazmul0087/ct-kidney-dataset-normal-cyst-tumor-and-stone
The model was trained on the CT Kidney Dataset containing 12,446 CT scan images across 4 classes. The dataset consists of coronal and axial cuts from PACS systems, verified by medical professionals.
## Ethical Considerations
- This model is for research and educational purposes only
- Not FDA approved or clinically validated
- Should not replace professional medical diagnosis
- Requires human oversight and clinical validation
- May have biases from training data distribution
## Citation
If you use this model in your research, please cite:
```bibtex
@misc{kidneyctclassifierefficientnet,
author = {Arko007},
title = {Kidney Ct Classifier Efficientnet},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/](https://huggingface.co/)Arko007/Kidney Ct Classifier Efficientnet}}
}
```
## License
Apache License 2.0 - See LICENSE file for details
## Contact
For questions or issues, please open an issue on the model repository.
## Acknowledgments
- Dataset: nazmul0087/ct-kidney-dataset-normal-cyst-tumor-and-stone
- Training infrastructure: NVIDIA A100 GPU
- Framework: PyTorch
|