Views
No views yet
grano1/core_sample_image_data dataset available via the HuggingFace eco-system. The model aims to predict one of the following four class labels - termed in accordance with DIN 4023 - from cropped core sample images (300x300 pixels):| 📈 Metric | Value |
|---|---|
| Categorical Cross-Entropy Loss | 0.0946 |
| Accuracy | 0.9718 |
| F1-score (macro, aggregated) | 0.8765 |
| F1-score (weighted, aggregated) | 0.9712 |
| Metric | Value |
|---|---|
| Batch size | 8 |
| Optimizer | AdamW |
| Warm-up ratio | 0.1 |
| Metric for best model | F1-Score (Macro) |
| Early stopping patience | 3 |
1# Load the dataset
2data_dataset = load_dataset("grano1/core_sample_image_data")
3
4# Load image processor and model
5processor = AutoImageProcessor.from_pretrained("grano1/core_sample_image_main_fraction_model")
6model = AutoModelForImageClassification.from_pretrained("grano1/core_sample_image_main_fraction_model")
7model.eval() # Set model to evaluation mode
8
9# Show sample features
10data_dataset["test"].features
11
12# Select sample from test set
13split = "test"
14sample = data_dataset[split][2] # Pick one sample
15image = sample["image"]
16
17# Prepare input for model
18inputs = processor(images=image, return_tensors="pt")
19
20# Run inference
21with torch.no_grad():
22 outputs = model(**inputs)
23 logits = outputs.logits
24 predicted_class = logits.argmax(dim=1).item()
25print(sample)
26
27# Get predicted and true label name
28id2label = model.config.id2label
29label2id = model.config.label2id
30predicted_label_name = id2label[predicted_class]
31
32# Show result
33print(f"✅ Predicted label: {predicted_label_name}")
34print(f"🧾 True label: {sample['HB']}")
35
36# Display image
37plt.imshow(sample['image'])
38plt.axis('off') # Hide axes
39plt.show()grano1/core_sample_image_data dataset includes more HB labels than the four identified by this model. This may require binning procedures, e.g., fS => S. Instructions can be found in the citation documented below.1@inproceedings{Granitzer.2025,
2 author = {Granitzer, Andreas-Nizar and Beck, Johannes and Leo, Johannes and Tschuchnigg, Franz},
3 title = {Explainable Insight into the Vision-Based Classification of Soil Core Samples from Close-Range Images},
4 pages = {228--233},
5 editor = {Uzielli, Marco and Phoon, Kok-Kwang},
6 booktitle = {Proceedings of the 3rd Workshop on the Future of Machine Learning in Geotechnics (3FOMLIG)},
7 year = {2025},
8 address = {Florence, Italy}
9}