Downloads · 30 days
7
11% of all-time downloads
MrLilian24/edena
edena is a image classification model from MrLilian24. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as cc-by-nc-sa-4.0.
EfficientNet-B0 model fine-tuned for soil type classification from images.
Downloads · 30 days
7
11% of all-time downloads
All-time downloads
65
Public
Repo size
16.4 MB
Likes
0
Public
Click a slice to open those files.
.bin16.4 MB · 100%
From the Hugging Face model README
EfficientNet-B0 model fine-tuned for soil type classification from images.
This model classifies soil images into 7 different types using transfer learning with EfficientNet-B0.
Classes: Alluvial_Soil, Arid_Soil, Black_Soil, Laterite_Soil, Mountain_Soil, Red_Soil, Yellow_Soil
Trained on the Comprehensive Soil Classification Datasets from Kaggle.
import torch
from torchvision import models, transforms
from PIL import Image
# Load model
model = models.efficientnet_b0()
in_features = model.classifier[1].in_features
model.classifier[1] = torch.nn.Linear(in_features, 7)
checkpoint = torch.load('pytorch_model.bin', map_location='cpu')
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
# Prepare image
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
img = Image.open('soil_image.jpg').convert('RGB')
img_tensor = transform(img).unsqueeze(0)
# Predict
with torch.no_grad():
output = model(img_tensor)
pred_idx = torch.argmax(output, dim=1).item()
classes = ['Alluvial_Soil', 'Arid_Soil', 'Black_Soil', 'Laterite_Soil', 'Mountain_Soil', 'Red_Soil', 'Yellow_Soil']
print(f"Predicted soil type: {classes[pred_idx]}")
Transfer learning approach:
GitHub: MrLilian24/edena
If you use this model in your research, please cite:
@misc{edena2025,
author = {Lavergne, Rémi},
title = {Edena: Soil Classification using Deep Learning},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/MrLilian24/edena}
}