Context
Delineating agricultural fields in satellite imagery underpins applications such as crop monitoring and agricultural statistics. Segmentation models produce masks for this task, but they often misplace boundaries, merge neighboring fields and split single fields into fragments.
Model-agnostic refiners correct the mask after segmentation, without changing or retraining the segmenter. Existing ones were designed for natural images, and their use on agricultural fields has focused on high-resolution imagery. At 10 m/pixel, small fields and narrow boundaries span only a few pixels.
Data and protocol
- PASTIS: 128 × 128 pixel patches of Sentinel-2 time series, with 10 bands per date and dozens of dates per patch.
- Validation: five geographic folds. Each patch’s initial mask comes from a segmentation model that never saw it during training.
- Metrics: IoU, recall and precision in both experiments; connected-component error (GTC) for maize; boundary IoU and per-field AP50/AR50 for all crops. Averages across folds.
Both experiments use the same dataset with different targets. Maize is a small, sparse class; all crops requires the refiner to separate each field from the background and from its neighbors.
Experiment 1 · maize
Target and initial masks
Maize against everything else: every other label counts as negative, and every pixel is scored. The initial masks come from three models: U-TAE and U-Net 3D, which use the full time series, and U-Net 2D, which uses only the median over dates and produces much worse masks.


IoU 80.1%
IoU 85.0%
IoU 22.8%Refiners
- Trained on PASTIS: fine-tuned SegRefiner, CascadePSP on the median RGB, and CascadePSP adapted to the 10 bands. Both CascadePSP variants were tuned on U-Net 2D masks and applied to the other two sources by transfer, without further tuning.
- No in-domain training: SAMRefiner and PromptMoE, with SAM ViT-H (RGB) and with HyperFree-H, a remote sensing foundation model that takes all 10 bands.
To use the 10 bands in CascadePSP without losing its RGB pretraining, I added connections for the 7 extra bands to the first convolution, with weights initialized to zero. At the start of training the network behaves exactly like the original; only these connections, the PSP module and the decoder are trained, and the encoder stays frozen.
Results
Change in IoU after refinement, in percentage points. Positive values are gains.
| U-TAE | U-Net 3D | U-Net 2D | |
|---|---|---|---|
| Initial mask IoU | 77.6% | 76.8% | 54.7% |
| SegRefiner | +0.3 ¹ | +0.4 | +2.0 |
| CascadePSP RGB | −1.5 ² | −0.8 ² | +2.2 |
| CascadePSP 10 bands | −1.4 ² | −1.0 ² | +2.7 |
| PromptMoE · SAM ViT-H | −15.1 | −14.1 | −7.5 |
| PromptMoE · HyperFree-H | −17.6 | −17.0 | −10.4 |
| SAMRefiner · SAM ViT-H | −24.1 | −23.9 | −16.1 |
| SAMRefiner · HyperFree-H | −15.3 | −14.9 | −8.5 |
¹ Three completed folds; all others have five. ² Applied by transfer, using the model tuned on U-Net 2D.
- Refinement pays off when the initial mask is poor. On U-Net 2D, the three refiners trained on PASTIS gain 2.0 to 2.7 IoU points, and GTC drops from 41.3% to 34.6% with the 10-band CascadePSP.
- On masks that are already good, there is little room. SegRefiner gains 0.3 to 0.4 points on U-TAE and U-Net 3D; CascadePSP, transferred without further tuning, loses up to 1.5 points.
- Refiners without in-domain training make every mask worse, by 7.5 to 24.1 points.
Examples
The same five test patches, all starting from the U-Net 2D mask. The first four rows are the best or worst case of some refiner, picked after evaluation; the last one was drawn at random. They show how much results vary from patch to patch, not average performance.

IoU 43.2%
IoU 86.7%
IoU 80.5%
IoU 34.3%30184 · best case for CascadePSP 10 bands
IoU 36.7%
IoU 58.4%
IoU 82.9%
IoU 44.6%30117 · best case for SegRefiner
IoU 51.4%
IoU 0.0%
IoU 90.3%
IoU 78.5%30363 · worst case for CascadePSP 10 bands
IoU 70.3%
IoU 82.0%
IoU 0.0%
IoU 77.4%30052 · random
IoU 22.8%
IoU 24.8%
IoU 34.2%
IoU 24.1%Experiment 2 · all crops
Target and initial masks
All agricultural fields against the background, on all 2,433 PASTIS patches. Each field’s margin counts as background, so neighboring fields are separated in the reference, and unlabeled areas are ignored. The initial masks come from HRNet and U-Net 2D, both on the 10 median bands, and from a NeuroFuser CNN that the refiner never saw during training.
Refiner
CascadePSP on the 10 bands, in two stages: pretraining on artificially degraded masks, which don’t depend on any segmentation model, then tuning on 80% real masks (HRNet and U-Net 2D in equal parts) and 20% synthetic ones, with a BCE loss plus an edge term. One model per fold. For comparison, SAMRefiner without training and SAMRefiner++, which uses LoRA to adapt the SAM ViT-B layer that estimates IoU and chooses among candidate masks.
Results
Change after refinement, in percentage points, averaged over five folds with 2,433 patches per segmentation model.
| HRNet | U-Net 2D | NeuroFuser CNN ³ | |
|---|---|---|---|
| Initial mask IoU | 71.5% | 70.7% | 71.1% |
| CascadePSP · IoU | −0.2 | +0.1 | 0.0 |
| CascadePSP · Boundary IoU | +0.6 | +0.8 | +0.9 |
| CascadePSP · AP50 | +0.8 | +2.6 | +3.0 |
| CascadePSP · AR50 | +1.3 | +3.2 | +3.9 |
| SAMRefiner · IoU | −3.4 | −3.0 | −3.2 |
| SAMRefiner · AP50 | −20.2 | −17.4 | −17.9 |
| SAMRefiner++ (LoRA) · IoU | −1.1 | −0.9 | −1.0 |
| SAMRefiner++ (LoRA) · AP50 | −7.7 | −6.9 | −7.4 |
³ Applied by transfer: no refiner was tuned on masks from this CNN.
- IoU barely moves, but fields are better separated. CascadePSP keeps IoU (−0.2 to +0.1) and improves boundaries (boundary IoU +0.6 to +0.9) and detection of individual fields (AP50 +0.8 to +3.0; AR50 +1.3 to +3.9). It gains precision and loses some recall (about 1.7 points).
- The gain holds on a segmentation model the refiner had never seen. The largest AP50 and AR50 gains are on the NeuroFuser CNN, applied by transfer only.
- SAM without adaptation makes things worse again, losing 3 IoU points and nearly 20 AP50 points. LoRA adaptation cuts the loss to about 1 IoU point, but still doesn’t improve on the initial mask.
Examples
One randomly drawn patch from each test fold, chosen using the reference only, before and after CascadePSP.


IoU 82.1%
IoU 81.7%
IoU 81.8%
IoU 81.5%30497 · fold 2

IoU 79.9%
IoU 80.6%
IoU 79.6%
IoU 81.0%10146 · fold 3

IoU 73.2%
IoU 73.7%
IoU 75.5%
IoU 75.2%20365 · fold 4

IoU 45.7%
IoU 44.5%
IoU 40.9%
IoU 42.4%30442 · fold 5

IoU 71.4%
IoU 70.9%
IoU 63.3%
IoU 65.3%What both show
- Refiners trained in-domain help where the initial mask is poor, as with maize on U-Net 2D. On reasonable masks they barely change IoU, but can improve boundaries and the separation between fields.
- SAM-based refiners, built for natural images, make the masks worse in both experiments. Adapting part of the model reduces the loss but doesn’t remove it.
Next steps
Identify the conditions under which each refiner fixes or harms the delineation, for example by field size and initial mask quality, and adapt refinement to 10 m/pixel imagery.
Advisor
Prof. Hugo Neves, Department of Informatics, UFV.
Stack
Semantic segmentation · Mask refinement · Remote sensing · PyTorch · Multispectral imagery · Fine-tuning · LoRA