xprotocol/EfficientNet-B3-Cattle-Disease
026
EfficientNet-B3 — Cattle Disease Detection
Fine-tuned EfficientNet-B3 (ImageNet pre-trained) for multi-class cattle disease classification using a two-phase transfer learning strategy.
Classes
Model Architecture
- Backbone: EfficientNet-B3 (300×300×3 input)
- Head: GAP → BatchNorm → Dropout(0.3) → Dense(256, ReLU) → Dropout(0.2) → Softmax(3)
- Loss: Focal Loss (γ=2, α=0.25)
- Optimizer: AdamW + Cosine Annealing with Warm Restarts
Training Details
Test Set Performance
Usage (TensorFlow / Keras)
import keras
# Download the .keras file from the Hub and load:
model = keras.models.load_model(
'efficientnet_b3_best.keras',
custom_objects={
'FocalLoss': FocalLoss,
'EfficientNetPreprocess': EfficientNetPreprocess,
}
)
# Predict (input: float32 numpy array of shape [N, 300, 300, 3] in [0, 255])
probs = model.predict(image_batch) # shape (N, 3)
CLASS_NAMES = ['foot-and-mouth', 'healthy', 'lumpy']
predicted_class = CLASS_NAMES[probs.argmax(axis=1)[0]]Dataset
Trained on devang03mgr/cattle-diseases-datasets. Stratified split: 70% train | 15% val | 15% test.
Citation
If you use this model, please cite the original EfficientNet paper:
Tan, M., & Le, Q. V. (2019). EfficientNet: Rethinking Model Scaling for Convolutional
Neural Networks. ICML 2019. https://arxiv.org/abs/1905.11946