Feedback

Faculté des Sciences appliquées
Faculté des Sciences appliquées
MASTER THESIS

Fine-tuning SAM for Grain Segmentation in Reflected-light Microscopy

Download
Campo, Adriaan ULiège
Promotor(s) : Pirard, Eric ULiège
Date of defense : 23-Jan-2026 • Permalink : http://hdl.handle.net/2268.2/25195
Details
Title : Fine-tuning SAM for Grain Segmentation in Reflected-light Microscopy
Translated title : [fr] Ajustement Fin de SAM pour la Segmentation des Grains en Microscopie à Lumière Réfléchi
Author : Campo, Adriaan ULiège
Date of defense  : 23-Jan-2026
Advisor(s) : Pirard, Eric ULiège
Committee's member(s) : Bouzahzah, Hassan ULiège
Nguyen, Frédéric ULiège
Language : English
Number of pages : 85
Keywords : [en] machine learning
[en] reflected light microscopy
[en] segment anything
[en] automated mineralogy
[en] vision transformers
[en] grain detection
Discipline(s) : Engineering, computing & technology > Geological, petroleum & mining engineering
Engineering, computing & technology > Computer science
Target public : Researchers
Professionals of domain
Institution(s) : Université de Liège, Liège, Belgique
Degree: Master en ingénieur civil des mines et géologue, à finalité spécialisée en géologie de l'ingénieur et de l'environnement
Faculty: Master thesis of the Faculté des Sciences appliquées

Abstract

[en] Automated grain segmentation in reflected-light microscopy (RLM) is a key step in quantitative texture analysis and automated mineralogy, yet it remains challenging due to weak and heterogeneous contrast, strong domain variability, and other factors. Classical image-processing approaches often lack robustness, while supervised deep-learning methods require large, domain-specific annotated datasets and frequently generalize poorly across materials. This work investigates the applicability of the Segment Anything Model (SAM), a promptable vision foundation model, for grain segmentation in RLM images and evaluates whether parameter-efficient fine-tuning (PEFT) can improve its performance.
First, we benchmark the zero-shot performance of SAM with ViT-B and ViT-H backbones against a fully supervised DeepLabV3+ model on two open-source ore microscopy datasets (iron ore and copper ore). Quantitative evaluation using pixel-wise metrics (IoU, Dice, precision, and recall) shows that SAM achieves segmentation accuracy comparable to DeepLabV3+ without any task-specific training, while demonstrating superior cross-dataset generalization. In contrast, DeepLabV3+ exhibits severe performance degradation when applied outside its training domain.
Second, we apply SAM to polished dolomite sections. For this dataset, SAM is compared with classical stereological measurements, different preprocessing strategies are tested, and we show that SAM yields quantitatively consistent textural descriptors. Moreover, we demonstrate that fine-tuning SAM improves both mask-level and full-field segmentation accuracy while updating only a small fraction of the model parameters.
Third, we apply SAM to industrial datasets of glass and silica grains from solar panels, which are challenging because the reflectivity of glass is close to that of the resin. The out-of-the-box versions of SAM can segment both glass and silica grains effectively.
Overall, the study shows that (i) SAM is a strong starting point for segmenting unseen RLM data, (ii) preprocessing can be critical for achieving good segmentation results with SAM, and (iii) small, targeted fine-tuning is an effective and practical path for improving foundation models in reflected-light microscopy segmentation tasks.
Finally, we release a Colab-ready codebase with a clear repository structure to support reproducibility.


File(s)

Document(s)

File
Access TFE_Adriaan_Campo_20252026.pdf
Description: Full thesis text
Size: 50.77 MB
Format: Adobe PDF
File
Access Abstract_TFE_Adriaan_Campo_20252026.pdf
Description: Abstract thesis
Size: 99.58 kB
Format: Adobe PDF

Author

  • Campo, Adriaan ULiège Université de Liège > Master ing. civ. min. geol. fin. spéc. géol. ing. env.

Promotor(s)

Committee's member(s)









All documents available on MatheO are protected by copyright and subject to the usual rules for fair use.
The University of Liège does not guarantee the scientific quality of these students' works or the accuracy of all the information they contain.