Introduction
When a disaster occurs, SERTIT must deliver crisis information within hours. Delays in delineating affected areas, such as burn scars or flood extents, can affect decision-making by civil protection authorities. To accelerate this process, the potential of Meta AI’s Segment Anything Model (SAM) was investigated for rapid mapping applications.
As part of an internship at SERTIT, Emanuele Gamba evaluated SAM and subsequently fine-tuned the model using very-high-resolution satellite imagery and wildfire annotations provided by the Copernicus Emergency Management Service (CEMS) Rapid Mapping program. This article presents the methodology, results, and implications of that work.
Exploration and preliminary testing
An initial evaluation was conducted using Geo-SAM, a QGIS plugin that enables SAM-based segmentation of geospatial data. A false-colour satellite image of a wildfire in Chios, Greece (Figure 1), was used for testing.

The segmentation results obtained during this phase are shown in Figure 2. SAM was able to generate rapid preliminary delineations using simple prompts, such as bounding boxes and point annotations, allowing areas of interest and exclusion to be identified efficiently. These results demonstrate the potential of SAM to support operators during disaster mapping.
However, several limitations were identified. Accurate delineation of complex burn scar boundaries proved challenging, particularly in areas with irregular shapes and fine spatial detail. More importantly, refining the initial segmentation to achieve operationally acceptable accuracy required substantial manual intervention. Such processing times are incompatible with the requirements of CEMS Rapid Mapping operations.
These findings indicated that adaptation of SAM to remote sensing imagery through domain-specific fine-tuning was necessary.

Fine-tuning methodology and dataset
Fine-tuning was performed through a workflow comprising data preparation and model training. All imagery and annotations were processed to satisfy SAM input requirements before training.
Among the three available SAM variants (Base, Large, and Huge), the Base model was selected to balance computational efficiency and performance. Although the Base version contains more than 90 million parameters, only the final layers of the network were updated during training, while the earlier layers remained frozen.
This approach preserved the general visual representations learned from millions of training images while adapting the model’s higher-level features to remote sensing data. Such adaptation is particularly important because SAM was originally trained on natural imagery rather than satellite observations.
The training objective combined Dice Loss and Focal Loss. This combination optimises both the overall overlap between predicted and reference masks and the classification of more ambiguous pixels, which are often critical in segmentation tasks. Fine-tuning was implemented using the official SAM Python library together with geospatial and machine-learning libraries, including Rasterio, GeoPandas, PyTorch, and TorchGeo.
The training dataset consisted primarily of multispectral, very-high-resolution wildfire imagery. Wildfires were selected because they represent one of the most frequent activation types within the CEMS framework and often require detailed delineation, particularly when very-high-resolution imagery is used.
Model evaluation and results
Model performance was evaluated using a wildfire dataset acquired over Mount Vesuvius, Italy (Figure 3).

Because satellite images are typically large, the test scene was divided into smaller patches. The locations of the five patch centres are shown in Figure 4.

For each patch, segmentation masks produced by the fine-tuned model were compared with the corresponding ground truth annotations. Performance was assessed using Precision, Recall, Intersection over Union (IoU), and F1-score metrics.
Figure 5 compares segmentation outputs from the baseline SAM model and the fine-tuned model against the ground truth. Across all examples, the fine-tuned model produced masks that more closely matched the reference annotations, whereas the baseline model exhibited larger spatial inaccuracies.